SodiumFRP / sodium

Sodium - Functional Reactive Programming (FRP) Library for multiple languages

Home Page:http://sodium.nz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More aggressive cleanup for switchC / switchS

clinuxrulz opened this issue · comments

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.

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.

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)