Skip to content

Speed up dropFunction by using a typed array instead of a sparse JS array.#4670

Merged
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:faster-drop-function
Jun 19, 2023
Merged

Speed up dropFunction by using a typed array instead of a sparse JS array.#4670
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:faster-drop-function

Conversation

@mstange

@mstange mstange commented Jun 16, 2023

Copy link
Copy Markdown
Contributor

This improves #4668 from 7.0 seconds to 1.6 seconds.

Before: https://share.firefox.dev/3qP8iB3
After: https://share.firefox.dev/43JVAC8

@codecov

codecov Bot commented Jun 16, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (ed4a724) 88.47% compared to head (197e034) 88.47%.

❗ Current head 197e034 differs from pull request most recent head f7ed6f4. Consider uploading reports for the commit f7ed6f4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4670      +/-   ##
==========================================
- Coverage   88.47%   88.47%   -0.01%     
==========================================
  Files         295      295              
  Lines       26299    26290       -9     
  Branches     7099     7097       -2     
==========================================
- Hits        23269    23260       -9     
  Misses       2818     2818              
  Partials      212      212              
Impacted Files Coverage Δ
src/profile-logic/transforms.js 91.42% <100.00%> (ø)

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice! It's always great to see how a very small change can have a huge impact! :)

I guess this will increase the memory usage a bit (since we are initializing the whole array now), but it's a very small thing compared to the impact.

@mstange mstange force-pushed the faster-drop-function branch from 197e034 to f7ed6f4 Compare June 19, 2023 15:18
@mstange mstange enabled auto-merge June 19, 2023 15:19
@mstange mstange merged commit 8a43076 into firefox-devtools:main Jun 19, 2023
@canova canova mentioned this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants