-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache contract id (and other frequent objects) in host #681
Comments
Decision: we're not going to do ubiquitous interning for now. It penalizes the common case (allocating actually-new objects) in favor of a rarer case (allocating duplicate objects). For objects we know we need to cache a widely-reused value of, we can cache that value. |
(we should still cache the contract ID, probably) |
Should probably also cache a variety of continuously-reused symbols and event-topic-vectors-containing-just-those-symbols. |
Discussed with @graydon and this can move to |
We fetch contract IDs as hashes fairly often, which means we're either copying around 32-byte hashes in the host or converting them to 8-byte
Object
s that hold handles pointing to bytes in the host object array. That latter approach is ok as far as it goes, but we don't unique those bytes, and we do a fair number of conversions, so it's possible that we're winding up with quite a lot of copies of a given contract ID in the host object array.We've talked about doing ubiquitous "interning" (forcing host objects to be unique when added to the table) and this is still a bit of a design decision to work through, but it should at least be possible to optionally ask for an object to be added uniquely, to cut down on cases like this.
The text was updated successfully, but these errors were encountered: