-
Notifications
You must be signed in to change notification settings - Fork 28
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
Performance of splice #405
Comments
I think we could have a test to catch this kind of regressions: const array1 = new Array(100000).fill(null);
const t1 = performance.now();
array1.splice(0, 1);
const t2 = performance.now();
const controlWindow = t2-t1;
const array2 = tracked(new Array(100000).fill(null));
const t3 = performance.now();
array2.splice(0, 1);
const t4 = performance.now();
const experimentWindow = t4-t3;
const deviation = 1.2; // 20%
assert.ok(experimentWindow < controlWindow*deviation) |
MichalBryxi
added a commit
to MichalBryxi/tracked-built-ins
that referenced
this issue
Jan 26, 2024
- 100k items means that the performance test will take ~0.25s (1.7 GHz Quad-Core Intel Core i7) and seems be failing reliably. - Added other assertions to make sure we're testing _real_ data and that we don't mutate the initial data set as we go. Relates to: tracked-tools#405
2 tasks
MichalBryxi
added a commit
to MichalBryxi/tracked-built-ins
that referenced
this issue
Jan 26, 2024
- 1M items means that the performance test will take 4.5s (1.7 GHz Quad-Core Intel Core i7). - We need enough items to make sure there is no zero in the comparison equation. Right now it's: `4423.399999976158 < 2 * 1.2` - Added other assertions to make sure we're testing _real_ data and that we don't mutate the initial data set as we go. Relates to: tracked-tools#405
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there anything that can be done to improve the performance of
.splice
vs.
The text was updated successfully, but these errors were encountered: