Newest at the top
| 2026-06-30 20:04:17 +0000 | <int-e> | Maybe prototype in Haskell... it's often more fun to tinker with algorithms in a higher level language. |
| 2026-06-30 20:04:03 +0000 | <EvanR> | according to legend that formula was invented by carl friedrich gauss when he was in 3rd grade |
| 2026-06-30 20:03:34 +0000 | <tomsmeding> | 8x speedup |
| 2026-06-30 20:03:30 +0000 | <tomsmeding> | yes, so I wrote some C code and linked that into haskell |
| 2026-06-30 20:03:17 +0000 | <int-e> | For the number crunching parts |
| 2026-06-30 20:03:15 +0000 | <tomsmeding> | ^ |
| 2026-06-30 20:03:11 +0000 | <int-e> | Nah just don't use Haskell. |
| 2026-06-30 20:03:03 +0000 | <tomsmeding> | I suppose |
| 2026-06-30 20:02:55 +0000 | <jaror> | Just use -fllvm :P |
| 2026-06-30 20:02:53 +0000 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Excess Flood) |
| 2026-06-30 20:02:44 +0000 | <tomsmeding> | now that's actually worth complaining about |
| 2026-06-30 20:02:28 +0000 | <int-e> | But this middle of the road approach really didn't agree with me :P |
| 2026-06-30 20:02:25 +0000 | <tomsmeding> | once you get into number crunching and unboxed arrays, very quickly discover that GHC does not vectorise array loops, and you shall cry in performance |
| 2026-06-30 20:02:14 +0000 | <int-e> | I know that it's missing the point entirely ;) |
| 2026-06-30 20:02:05 +0000 | <int-e> | I'm just jumping to the end of jaror's road. |
| 2026-06-30 20:01:41 +0000 | <tomsmeding> | I mean, yes, you can optimise this to nothingness but that's not the point :p |
| 2026-06-30 20:01:22 +0000 | <lambdabot> | 500000500000 |
| 2026-06-30 20:01:20 +0000 | <int-e> | > let n = 1000000 in fromInteger (n*(n+1) `div` 2) :: Int |
| 2026-06-30 20:00:55 +0000 | <tomsmeding> | jaror: this is purposefully written this way to be the thing that absentia complained about :p |
| 2026-06-30 19:59:47 +0000 | <jaror> | tomsmeding: You can speed it up a bit with mapM and enumFromTo :) |
| 2026-06-30 19:59:27 +0000 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-06-30 19:58:55 +0000 | <EvanR> | so chonky |
| 2026-06-30 19:58:40 +0000 | <int-e> | EvanR: apparently! |
| 2026-06-30 19:58:14 +0000 | <EvanR> | 1 million boxed ints? |
| 2026-06-30 19:57:36 +0000 | <int-e> | meanwhile, maybe each of the 5k things has a 1GB blob :) |
| 2026-06-30 19:57:08 +0000 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) Lord_of_Life |
| 2026-06-30 19:56:59 +0000 | <int-e> | (you still have to marshal the data at least) |
| 2026-06-30 19:56:47 +0000 | <tomsmeding> | even if pipelined |
| 2026-06-30 19:56:32 +0000 | <tomsmeding> | doing 1 million individual insert queries in postgres is going to take longer than 200ms |
| 2026-06-30 19:55:25 +0000 | <tomsmeding> | I did for you what EvanR suggested |
| 2026-06-30 19:55:12 +0000 | <tomsmeding> | and actually that is not only the traverse, also a separate Data.Foldable.sum of the results afterwards |
| 2026-06-30 19:54:47 +0000 | <tomsmeding> | I can sum 1 million ints in a vector using traverse in IO in 820 ms in the interpreter, 344 ms compiled -O0, and 204ms compiled -O1 |
| 2026-06-30 19:54:20 +0000 | ski | (~ski@31-208-30-244.cust.bredband2.com) ski |
| 2026-06-30 19:54:15 +0000 | <tomsmeding> | absentia: https://paste.tomsmeding.com/tjiAWaX1 |
| 2026-06-30 19:48:33 +0000 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
| 2026-06-30 19:46:14 +0000 | <monochrom> | Danse Macabre is a necromancy performance. >:) |
| 2026-06-30 19:45:39 +0000 | <int-e> | sounds more magical that way, like necromancy |
| 2026-06-30 19:45:23 +0000 | <int-e> | Hmm, "performancy" is cute. |
| 2026-06-30 19:45:03 +0000 | <int-e> | absentia: If you have no idea where the time is spent, profile first unless your code base *including* dependencies, except the ones whose performancy characteristics you understand perfectly is very small. |
| 2026-06-30 19:44:05 +0000 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-06-30 19:44:02 +0000 | <tomsmeding> | int-e: both can be true at the same time |
| 2026-06-30 19:43:49 +0000 | <int-e> | Or few. |
| 2026-06-30 19:43:48 +0000 | <EvanR> | instead of guessing, blaming random things, and try to spread FUD |
| 2026-06-30 19:43:48 +0000 | <monochrom> | Yeah we need more "falsify your own hypotheses" attitudes. |
| 2026-06-30 19:43:37 +0000 | <int-e> | tomsmeding: Yes I have little constructive things to add ;) |
| 2026-06-30 19:43:29 +0000 | <absentia> | hnnngh |
| 2026-06-30 19:43:27 +0000 | <EvanR> | so you can get some more targeted claims more likely to be the problem |
| 2026-06-30 19:43:27 +0000 | <absentia> | yes it's always "profile first" isn't it |
| 2026-06-30 19:43:14 +0000 | <int-e> | Anyway. Profile, or read the library code trying to understand where the time might be spent. I'd think that profiling will be far less effort for starters. |
| 2026-06-30 19:43:09 +0000 | <EvanR> | if it wasn't obvious what would happen, I'd be temped to make minimal test cases to disprove all your claims, like it's impossible to quickly traverse 5000 items with a vector, etc |