Skip to content

refactor(napi/parser): raw transfer: store offsets as consts#12268

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts
Jul 14, 2025
Merged

refactor(napi/parser): raw transfer: store offsets as consts#12268
graphite-app[bot] merged 1 commit intomainfrom
07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 14, 2025

Pure refactor. Instead of hard-coding constants for fixed offsets of data in the buffer, generate these constants in one place and import them from constants.js everywhere else.

Copy link
Member Author

overlookmotel commented Jul 14, 2025


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.

@github-actions github-actions bot added A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jul 14, 2025
@overlookmotel overlookmotel marked this pull request as ready for review July 14, 2025 14:08
@overlookmotel overlookmotel marked this pull request as draft July 14, 2025 14:11
@graphite-app graphite-app bot changed the base branch from 07-14-refactor_ast_tools_introduce_structdef_field_by_name_method to graphite-base/12268 July 14, 2025 14:23
@graphite-app graphite-app bot force-pushed the graphite-base/12268 branch from 631a07e to 91b9905 Compare July 14, 2025 14:31
@graphite-app graphite-app bot force-pushed the 07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts branch from 3d49ab3 to 10f2b27 Compare July 14, 2025 14:31
@graphite-app graphite-app bot changed the base branch from graphite-base/12268 to main July 14, 2025 14:32
@graphite-app graphite-app bot force-pushed the 07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts branch from 10f2b27 to 52f14d2 Compare July 14, 2025 14:32
@overlookmotel overlookmotel changed the base branch from main to graphite-base/12268 July 14, 2025 18:43
@overlookmotel overlookmotel force-pushed the 07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts branch from 52f14d2 to a3f85ed Compare July 14, 2025 18:43
@overlookmotel overlookmotel changed the base branch from graphite-base/12268 to 07-14-perf_napi_parser_raw_transfer_move_check_for_supported_platform July 14, 2025 18:43
@overlookmotel overlookmotel marked this pull request as ready for review July 14, 2025 18:46
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jul 14, 2025
Copy link
Member Author

overlookmotel commented Jul 14, 2025

Merge activity

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 14, 2025

CodSpeed Instrumentation Performance Report

Merging #12268 will not alter performance

Comparing 07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts (a3f85ed) with main (f130a0c)

Summary

✅ 34 untouched benchmarks

Pure refactor. Instead of hard-coding constants for fixed offsets of data in the buffer, generate these constants in one place and import them from `constants.js` everywhere else.
@graphite-app graphite-app bot force-pushed the 07-14-perf_napi_parser_raw_transfer_move_check_for_supported_platform branch from 9d4945b to 28be5de Compare July 14, 2025 18:56
@graphite-app graphite-app bot force-pushed the 07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts branch from a3f85ed to d009bdb Compare July 14, 2025 18:57
Base automatically changed from 07-14-perf_napi_parser_raw_transfer_move_check_for_supported_platform to main July 14, 2025 19:04
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 14, 2025
@graphite-app graphite-app bot merged commit d009bdb into main Jul 14, 2025
16 checks passed
@graphite-app graphite-app bot deleted the 07-14-refactor_napi_parser_raw_transfer_store_offsets_as_consts branch July 14, 2025 19:05
graphite-app bot pushed a commit that referenced this pull request Jul 14, 2025
… align as consts (#12275)

Similar to #12268. Instead of hard-coding the size and alignment of raw transfer buffers in multiple places, codegen add these to generated files, and everywhere else import the values from those files. This is more robust.
graphite-app bot pushed a commit that referenced this pull request Jul 14, 2025
Pure refactor. Introduce a `RawTransferMetadata` struct to hold metadata that gets written to end of buffer. Codegen use knowledge of memory layout of this struct to generate constants added in #12268. This is more robust than manually calculating offsets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant