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
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
The reason will be displayed to describe this comment to others. Learn more.
You might want to clean up the implementation in JAvascriptStaticEnumerator.h and DynamicObjectPropertyEnumerator.h as well, as I don't see other references to those. #Resolved
The reason will be displayed to describe this comment to others. Learn more.
:: [](start = 35, length = 2)
Fantastic wins.
So if I understand - obj is typed array, so this will call to the DirectGetItem of typed array which will have unnecessary checks being detached and others . Could that be avoided (or it is already avoided)?
It's because spec has very different way they serialize normal arrays vs. other objects. Normal arrays only serialize elements up to length, but typed arrays will need to serialize all properties (e.g. if i say typedArr.prop = "blah" we need to serialize that). So I'd rather just use the normal enumerator rather than trying to be fancy
In reply to: 373793434 [](ancestors = 373793434,373783535)
Refers to: lib/Runtime/Library/JSONStringifier.cpp:811 in 45caec1. [](commit_id = 45caec1, deletion_comment = False)
Merge pull request #4831 from MikeHolman:arrenum
During enumeration, we can (and should) avoid creating PropertyRecords for TypedArrays. Instead we can use the numeric index.
In the below micro-benchmark, this improves our perf by about 45%.
````
const view = new Int8Array(1 << 24);
for (let i = 0; i < view.length; ++i) {
view[i] = i|0;
}
var start = Date.now();
const str = JSON.stringify(view);
console.log(Date.now() - start);
````
OS: 16385822
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.
During enumeration, we can (and should) avoid creating PropertyRecords for TypedArrays. Instead we can use the numeric index.
In the below micro-benchmark, this improves our perf by about 45%.
OS: 16385822