Closed raskad closed 1 week ago
Test result | main count | PR count | difference |
---|---|---|---|
Total | 50,213 | 50,213 | 0 |
Passed | 42,981 | 42,981 | 0 |
Ignored | 1,411 | 1,411 | 0 |
Failed | 5,821 | 5,821 | 0 |
Panics | 0 | 0 | 0 |
Conformance | 85.60% | 85.60% | 0.00% |
Really nice optimization! I'm seeing that all our usages of the new method are made internally, so I was curious if we could set up inline caching manually to optimise the calls even more.
EDIT: cc @HalidOdat
Yeah that was one of the things that could be optimized, though I didn't find a good way of doing it, one potentially viable idea I had was to have a global hash table on the context (with limited entries).
This PR creates a new object operation that combines the
HasProperty
andGet
operations.In some cases in the spec
HasProperty
andGet
are called on an object, with the same arguments, directly following each other. Both operations boil down to (in most cases)[[GetOwnProperty]]
, just thatHasProperty
does not return the value. To avoid duplicating the exact same operations we can combine both operations.I have some Flame Graphs from a
GetName
operation to visualize the benefit:Before:
After:
![image](https://github.com/boa-dev/boa/assets/32105367/3c40335f-bd4e-4944-abd4-947db741fcb3)
I also ran the benchmarks:
Before:
After: