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'm putting this up as a discussion piece, more than anything. Wins are minimal, at best.
The thinking was that every VmObject gets its cachedValues initialised by default, but only the ones that are forced get those values filled. However, cachedValues.entries is null by default. There appears to be a bigger possible win to address the fact that a lot of EconomicMaps have entries be an oversized array (Object[8] by default).
If the wins are minimal, I'm not sure they are worth the additional code and runtime checks. For typed objects, cachedValues could probably be removed altogether by switching to Truffle's static object model.
Speaking of small wins, there are several places in the codebase where EconomicMap.create() could be safely replaced with EconomicMap.emptyMap() because the map is effectively read-only. I tried this a few weeks ago but didn't send a PR because I had too many pending PRs.
I agree. I am still looking into replacing members with something a little more compact, because of frequent over-allocation there. I'm skeptical it'll be significant, but it's worth the experiment, at least.
How do you do your memory profiling? members is often shared between objects created by the same new/amend expression. Are specific code constructs, such as for-generators, responsible for what you're seeing?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm putting this up as a discussion piece, more than anything. Wins are minimal, at best.
The thinking was that every
VmObjectgets itscachedValuesinitialised by default, but only the ones that are forced get those values filled. However,cachedValues.entriesisnullby default. There appears to be a bigger possible win to address the fact that a lot ofEconomicMaps haveentriesbe an oversized array (Object[8]by default).