Cache standard objects (Array
, Object
, etc) and there prototypes
#613
Labels
discussion
Issues needing more discussion
execution
Issues or PRs related to code execution
help wanted
Extra attention is needed
performance
Performance related changes and issues
What is the problem with the current implementation?
The problem is that when we access a standard object we use
.get_field()
to get it from the global object, the problem is that we have to do a hashmap lookup and.get_field()
does other checks that are not necessary.we have to do:
or to get the prototype we have to do two HashMap lookups
Proposed changes
Store the common standard objects in the realm/interpreter as struct fields maybe:
This way if we need to access the prototype of for example
Function
object we do something like:This way we avoid all the unnecessary
HashMap
lookups and the checks from.get_field()
The text was updated successfully, but these errors were encountered: