While benchmarking vs. MobX, I've noticed tink_state taxes the GC quite a bit more. Haven't profiled it yet, but two things seem to stand out as relatively obvious:
Invalidator is the basis of all things and it subscribes every Invalidatable only once. The usage of a CallbackList is therefore not necessary, and the allocation of the CallbackLink can be avoided in favor of a method to unsubscribe an Invalidatable (by identity) again.
The data contained in SubscribtionTo can be inlined into AutoObservable.
While benchmarking vs. MobX, I've noticed tink_state taxes the GC quite a bit more. Haven't profiled it yet, but two things seem to stand out as relatively obvious:
Invalidator
is the basis of all things and it subscribes everyInvalidatable
only once. The usage of aCallbackList
is therefore not necessary, and the allocation of theCallbackLink
can be avoided in favor of a method to unsubscribe anInvalidatable
(by identity) again.SubscribtionTo
can be inlined intoAutoObservable
.