effekt-lang / effekt

A language with lexical effect handlers and lightweight effect polymorphism
https://effekt-lang.org
MIT License
334 stars 24 forks source link

Don't use weak refs #647

Closed b-studios closed 2 weeks ago

b-studios commented 1 month ago

Running the benchmark permute 10 crashes nodejs.

In this PR, I investigate not using weak references to see how this affects performance.

Here are preliminary results:

image

Those benchmarks that heavily use references, like permute, seem to benefit from not using weak refs.

With this change, permute 10 still crashes, but doesn't mention weak references anymore. It looks like we just run out of memory.

Please bare in mind that not using weak refs might lead to holding too long onto a references that could have been freed before.