Skip to content

perf(napi/parser): lazy deser: speed up creating NodeArrays#11869

Merged
graphite-app[bot] merged 1 commit intomainfrom
06-23-perf_napi_parser_lazy_deser_speed_up_creating_nodearray_s
Jun 23, 2025
Merged

perf(napi/parser): lazy deser: speed up creating NodeArrays#11869
graphite-app[bot] merged 1 commit intomainfrom
06-23-perf_napi_parser_lazy_deser_speed_up_creating_nodearray_s

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jun 23, 2025

NodeArray store length as an internal property, rather then creating an underlying Array with that length. This is much faster when the array is large.

Produces an 18x speed-up in getting program.body for cal.com.tsx benchmark fixture, because it has 3942 statements.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Jun 23, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@overlookmotel overlookmotel marked this pull request as ready for review June 23, 2025 17:06
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jun 23, 2025
Copy link
Member Author

overlookmotel commented Jun 23, 2025

Merge activity

`NodeArray` store length as an internal property, rather then creating an underlying `Array` with that length. This is much faster when the array is large.

Produces an 18x speed-up in getting `program.body` for `cal.com.tsx` benchmark fixture, because it has 3942 statements.
@graphite-app graphite-app bot force-pushed the 06-23-perf_napi_parser_lazy_deser_speed_up_creating_nodearray_s branch from 0991f60 to fb02e6c Compare June 23, 2025 17:21
@graphite-app graphite-app bot merged commit fb02e6c into main Jun 23, 2025
15 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jun 23, 2025
@graphite-app graphite-app bot deleted the 06-23-perf_napi_parser_lazy_deser_speed_up_creating_nodearray_s branch June 23, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant