SodiumFRP / sodium

Sodium - Functional Reactive Programming (FRP) Library for multiple languages
http://sodium.nz/
Other
850 stars 140 forks source link

More aggressive cleanup for switchC / switchS #167

Closed clinuxrulz closed 5 years ago

clinuxrulz commented 5 years ago

Seems like switchC / switchS rely on the garbage collector to call the cleanup of the last internally linked cell/stream. I think this can be done a little more aggressively to save on some CPU time used for the last updated cell/stream that is not observed (clean up internal listener as well when external gets cleaned up).

This is of low priority.

clinuxrulz commented 5 years ago

If using sodium normally, this extra CPU time (until gc) will only be seen from a switchC/switchS inside a switchC/switchS. Otherwise it goes unnoticed.

clinuxrulz commented 5 years ago

Actually this will not help as the created sodium object will just live until it is garbage collected anyway. And its value will always be updated even if it is unobserved. (until push-pull)