mangobot 2017-02-11 03:46:31
cocreature can i leave the !! part from the fen function but then still access the first string somehow?
mangobot 2017-02-11 03:46:40
to use it in the parseBoard function?
AndreasK 2017-02-11 03:49:26
kgadek: Seems like ocalm hashtables are mutable, that would explain much of the difference
kgadek 2017-02-11 03:49:50
of course
kgadek 2017-02-11 03:50:13
I'm not that surprised by this result
kgadek 2017-02-11 03:50:19
only by Cuckoo vs Basic
cocreature 2017-02-11 03:52:13
mangobot: sry I don't have the time right now to explain every error in your code. here's a version that typechecks http://lpaste.net/352383. You still need to replace the underscore by something that produces a list of strings given board & color
mangobot 2017-02-11 03:52:38
cocreature ok thanks a lot for the help
AndreasK 2017-02-11 03:53:39
kgadek: The hash of ints are their values, I assume the performance issues might arise from that
kgadek 2017-02-11 03:54:11
AndreasK: oh? really?
AndreasK 2017-02-11 03:54:26
kgadek: As in insert is faster for random hashes, but inserting hashes which are strictly ascending would at least be an edge case
kgadek 2017-02-11 03:54:46
instance Hashable Int where hash = id
kgadek 2017-02-11 03:54:50
oh my, this is really the case
kgadek 2017-02-11 03:56:07
but wait
kgadek 2017-02-11 03:56:40
Cuckoo's `insert` uses `updateOrFail` which internally uses both `hash` and `hashWithSalt`
kgadek 2017-02-11 03:59:25
AndreasK: ok, I don't know too much about Cuckoo hashing so I give up slightly in trying to explain this
AndreasK 2017-02-11 03:59:39
kgadek: What does it use as salt?
kgadek 2017-02-11 03:59:52
hashPrime = if wordSize == 32 then hashPrime32 else hashPrime64
kgadek 2017-02-11 03:59:52
where
kgadek 2017-02-11 03:59:52
hashPrime32 = 0xedf2a025
kgadek 2017-02-11 03:59:52
hashPrime64 = 0x3971ca9c8b3722e9
AndreasK 2017-02-11 04:02:10
kgadek: If you care enough you could try to insert ints with random keys and check the difference then
kgadek 2017-02-11 04:02:49
AndreasK: in a sec, I'm learning F# now :D
cocreature 2017-02-11 04:02:50
just make sure you are not benchmarking your prng
kgadek 2017-02-11 04:06:38
…wut. `fsharpc` is making me .exe files. On my OSX. Like srsly? Ehh
kgadek 2017-02-11 04:06:43
anyway, F# is blazing fast
kgadek 2017-02-11 04:06:53
0,47s vs 4.4s for OCaml and Haskell
kgadek 2017-02-11 04:06:58
wondering what it does internally
kgadek 2017-02-11 04:09:57
anyone got .net disassembler?
AndreasK 2017-02-11 04:15:17
kgadek: Maybe more aggressive resizing
kgadek 2017-02-11 04:15:36
I suspect that .Net could optimize something away
AndreasK 2017-02-11 04:20:58
kgadek: If you presize the Cuckoo hashtable its also below 4s in time
kgadek 2017-02-11 04:21:15
AndreasK: oh, nice
SrPx 2017-02-11 04:21:35
Hey guys, this program is taking 2s to execute here. Am I doing something wrong? I think I have -O2 (I included it on ghc-options on .cabal). The equivalent JS program takes 20ms to complete so that can't be right.
SrPx 2017-02-11 04:21:38
http://lpaste.net/352384
AndreasK 2017-02-11 04:22:57
kgadek: nevermind hat the wrong type alias, gets faster by a lot though
kgadek 2017-02-11 04:22:59
btw, I was thinking that .Net could optimize sth away. But if my math is right, this may not be the case. Let's be generous and assume 0,48s for whole program is only in the tight loop. That means that on my 2GHz machine, it spends 96 instructions per loop, or 48ns. This is… plausible?
kgadek 2017-02-11 04:23:57
for OCaml & Haskell, this gives 896 instructions / 448ns
Tuplanolla 2017-02-11 04:24:02
Try `import qualified Data.Vector.Unboxed as V`, SrPx.
SrPx 2017-02-11 04:24:21
Wooops
kgadek 2017-02-11 04:24:29
AndreasK: so the question that remains: is 100 instructions for inserting value into hashtable possible.
SrPx 2017-02-11 04:24:52
Thanks and sorry
kgadek 2017-02-11 04:25:20
yes => something's wrong in Haskell OCaml. no => something magical is happening in fsharpc compiler
AndreasK 2017-02-11 04:26:33
kgadek: F sharp probably uses the equivalent of unboxed ints
AndreasK 2017-02-11 04:29:04
kgadek: And it's hard to say if thats realistic since we don't know if/how often the map gets resized. But without resizing I would say its certainly possible with a simple hash and few conflicts
joneshf-laptop 2017-02-11 04:29:18
So, HLearn is effectively stymied and impossible to install. Is there anything like it around that's still active?
joneshf-laptop 2017-02-11 04:29:57
"Like it" meaning cares about algebra, instead of just wanting to have pandas in haskell.
SrPx 2017-02-11 04:30:37
So, why adding more `incAll` calls degrades his program's performance? http://lpaste.net/352385 -- I assumed that, due to fusion, all those `incAll`s would be compiled to a single pass...
Rotaerk 2017-02-11 04:31:25
someone say "pandas in haskell"?! that'd be awesome
kgadek 2017-02-11 04:33:46
AndreasK: I don't think it's possible to use Int# in this implementation though :<
joneshf-laptop 2017-02-11 04:34:08
Rotaerk, don't things like that already exist?
joneshf-laptop 2017-02-11 04:34:22
Rotaerk, unless I really don't understand pandas.
Rotaerk 2017-02-11 04:34:37
oh, "pandas" is the name of something? darn
AndreasK 2017-02-11 04:36:08
kgadek: That's a drawback with synthetic benchmarks, hard to tell how much they matter for real use cases ...
kgadek 2017-02-11 04:36:24
AndreasK: ok, no more ideas for how to make Haskell quicker. We're in 8-9x range comparing to F# now
kgadek 2017-02-11 04:36:50
true, though this one is quite dissatisfying
AndreasK 2017-02-11 04:39:23
kgadek: It's not a good comparison either way when you try to match implementations, more sensible would be to compare something like whats the fastest way to associate integers with integers.
kgadek 2017-02-11 04:40:10
hm, IMHO that's a different kind of benchmark. Comparing implementations makes sense for me
kgadek 2017-02-11 04:40:26
BTW, there was somewhere this paper about encoding boxiness in kinds…
kgadek 2017-02-11 04:40:57
anyone remember/know it? can't find it
Tuplanolla 2017-02-11 04:41:12
That's "levity", kgadek.
kgadek 2017-02-11 04:41:23
Tuplanolla: thanks!
AndreasK 2017-02-11 04:41:36
Well haskell's whole runtime is built on the idea that you take advantage of sharing and lazyness, imperative algorithms will pretty much always be slower in haskell for that reason imo
AndreasK 2017-02-11 04:42:16
Although a factor 10 seems high still
kgadek 2017-02-11 04:43:08
well, if something is slower b/c of sharing/laziness then there shall be an option to disable them. E.g. BangPatterns do quite a good job usually