You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no idea whether this would have any effect on performance at all, but it would definitely be entertaining to see. Technically, I think this is possible by storing a reference to the dictionary that holds the entry inside that entry. If I remember correctly, the only reason I created the Entry object at all is (a) for tagging opener/pusher & consequent polymorphic on_open etc., and (b) to save on lookups during submit without having to handwrite custom submit lookup method (in a very naive implementation, we'd have to have two lookups: one to find out whether the entry exists, and another to store).
A tiny benchmark would be nice, will put it here before everything.
The text was updated successfully, but these errors were encountered:
The thing is actually slower because Crystal's hash methods are clumsy for this particular use case. To make use of the struct entries, we have to first find that struct entry in the dictionary, and then to submit to it, we have to again find it (Hash(K, V)#update and Hash(K, V)#[]=) and only then write.
As with everything, this could be resolved by writing a custom hash table implementation. Maybe, maybe not. I'm not in the mood of doing this -- there are much more interesting Substrate and Tape optimizations coming (hopefully!)
I have no idea whether this would have any effect on performance at all, but it would definitely be entertaining to see. Technically, I think this is possible by storing a reference to the dictionary that holds the entry inside that entry. If I remember correctly, the only reason I created the Entry object at all is (a) for tagging opener/pusher & consequent polymorphic
on_open
etc., and (b) to save on lookups during submit without having to handwrite custom submit lookup method (in a very naive implementation, we'd have to have two lookups: one to find out whether the entry exists, and another to store).A tiny benchmark would be nice, will put it here before everything.
The text was updated successfully, but these errors were encountered: