
Dear ghc devs, would the StablePtr performance issue (slow hash table) https://ghc.haskell.org/trac/ghc/ticket/13165 also affect StableNames? Cf. https://github.com/ekmett/ersatz/issues/30 Could making 10^5 stable names, and accessing each just once, take noticeable time? Where would this show up in a profile? I guess there's no easy way to change the ersatz library (StableName this is the fundamental mechanism for detecting sharing) but if these issues are related, then ersatz provides a performance test case. Thanks, Johannes.

StableNames do use the RTS hash table implementation, but StablePtr does *not*, the ticket is incorrect. But to be clear, nothing has changed - StableName has always used this hash table implementation. No doubt it could be faster if we used a better hash table, but whether it matters to you or not depends on what else your application is doing - is StableName in the inner loop? You'd have to measure it. Cheers Simon On 22 January 2017 at 16:09, Johannes Waldmann < johannes.waldmann@htwk-leipzig.de> wrote:
Dear ghc devs,
would the StablePtr performance issue (slow hash table) https://ghc.haskell.org/trac/ghc/ticket/13165 also affect StableNames? Cf. https://github.com/ekmett/ersatz/issues/30
Could making 10^5 stable names, and accessing each just once, take noticeable time? Where would this show up in a profile?
I guess there's no easy way to change the ersatz library (StableName this is the fundamental mechanism for detecting sharing) but if these issues are related, then ersatz provides a performance test case.
Thanks, Johannes. _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Add this conversation to #13165?
From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Simon Marlow
Sent: 24 January 2017 09:38
To: Johannes Waldmann

Dear Simon, thanks for looking into this.
is StableName in the inner loop?
Yes. This application's inner loop uses a HashMap (StableName Expression) Int for memoization. This is the Tseitin transform: for each node, build a literal. Each node is stable-named. I guess the RTS's hashmap performance comes into play only when pointers are moved (in GC). The application's hashmap cost will dominate, because it's used more often.
You'd have to measure it.
I did. It seems we're good on StableNames, and time goes elsewhere. https://github.com/ekmett/ersatz/issues/30#issuecomment-274775792 - Johannes.
participants (3)
-
Johannes Waldmann
-
Simon Marlow
-
Simon Peyton Jones