Skip to content

More optimizations; particularly for tuples - #795

Merged
liuzicheng1987 merged 20 commits into
mainfrom
f/more_optimizations
Nov 23, 2026
Merged

liuzicheng1987 merged 20 commits into
mainfrom
f/more_optimizations

Conversation

@liuzicheng1987

Copy link
Copy Markdown
Collaborator

No description provided.

@liuzicheng1987 liuzicheng1987 changed the title More optimizatoins; particularly for tuples More optimizations; particularly for tuples Nov 23, 2026
@liuzicheng1987
liuzicheng1987 merged commit 1b25d8f into main Nov 23, 2026
355 of 356 checks passed
@liuzicheng1987
liuzicheng1987 deleted the f/more_optimizations branch November 23, 2026 21:35
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 29, 2026
…tors, and flatten

Moves per-field serialization, schema building, missing-field handling, and
destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free
templates parameterized only on each field's type (never the enclosing
`NamedTuple` pack), and skips instantiating destructors for trivially
destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on
wide structs with zero public API changes.

Split from parser-symbol-isolation (#118) into an independent, reviewable chunk
(no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader`
isolation follow in separate commits).

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
Downstream receipts (combined Wave 1 N=3 interleaved medians vs main):
- hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall
- openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall
- FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall
- games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 29, 2026
…WithDefault

Lifts per-field parsing, placement-move, move-assign, error-recording, and
extra-field helpers out of `ViewReader<..., ViewType, ...>` and
`ViewReaderWithDefault<..., ViewType, ...>` into free function templates
parameterized only by each field's type (never the enclosing `ViewType`),
keeping linear field-name dispatch (inline for `size_ <= 4`, out-of-line for
wider structs) and the compile-time positional read fast path.

Parent: depends on `fix(parsing): capture input keys matching ExtraFields member name`
(preserving the `is != ViewType::pos_extra_fields()` guard). Independent of
`NamedTupleParser` helper isolation; wide-struct `FieldNameLookup` follows in
a dedicated child commit.

Judge polish applied:
- Zero `[[maybe_unused]]` annotations (per munich-data-engineering#582): unmatched-name handling
  dispatches directly into `handle_extra_field*` / `handle_no_extra_fields_error`
  with only the parameters used by each branch.

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 29, 2026
…tors, and flatten

Moves per-field serialization, schema building, missing-field handling, and
destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free
templates parameterized only on each field's type (never the enclosing
`NamedTuple` pack), and skips instantiating destructors for trivially
destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on
wide structs with zero public API changes.

Split from parser-symbol-isolation (#118) into an independent, reviewable chunk
(no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader`
isolation follow in separate commits).

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
Downstream receipts (combined Wave 1 N=3 interleaved medians vs main):
- hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall
- openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall
- FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall
- games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 29, 2026
…WithDefault

Lifts per-field parsing, placement-move, move-assign, error-recording, and
extra-field helpers out of `ViewReader<..., ViewType, ...>` and
`ViewReaderWithDefault<..., ViewType, ...>` into free function templates
parameterized only by each field's type (never the enclosing `ViewType`),
keeping linear field-name dispatch (inline for `size_ <= 4`, out-of-line for
wider structs) and the compile-time positional read fast path.

Parent: depends on `fix(parsing): capture input keys matching ExtraFields member name`
(preserving the `is != ViewType::pos_extra_fields()` guard). Independent of
`NamedTupleParser` helper isolation; wide-struct `FieldNameLookup` follows in
a dedicated child commit.

Judge polish applied:
- Zero `[[maybe_unused]]` annotations (per munich-data-engineering#582): unmatched-name handling
  dispatches directly into `handle_extra_field*` / `handle_no_extra_fields_error`
  with only the parameters used by each branch.

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 29, 2026
…tors, and flatten

Moves per-field serialization, schema building, missing-field handling, and
destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free
templates parameterized only on each field's type (never the enclosing
`NamedTuple` pack), and skips instantiating destructors for trivially
destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on
wide structs with zero public API changes.

Split from parser-symbol-isolation (#118) into an independent, reviewable chunk
(no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader`
isolation follow in separate commits).

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
Downstream receipts (combined Wave 1 N=3 interleaved medians vs main):
- hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall
- openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall
- FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall
- games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 29, 2026
…WithDefault

Lifts per-field parsing, placement-move, move-assign, error-recording, and
extra-field helpers out of `ViewReader<..., ViewType, ...>` and
`ViewReaderWithDefault<..., ViewType, ...>` into free function templates
parameterized only by each field's type (never the enclosing `ViewType`),
keeping linear field-name dispatch (inline for `size_ <= 4`, out-of-line for
wider structs) and the compile-time positional read fast path.

Parent: depends on `fix(parsing): capture input keys matching ExtraFields member name`
(preserving the `is != ViewType::pos_extra_fields()` guard). Independent of
`NamedTupleParser` helper isolation; wide-struct `FieldNameLookup` follows in
a dedicated child commit.

Judge polish applied:
- Zero `[[maybe_unused]]` annotations (per munich-data-engineering#582): unmatched-name handling
  dispatches directly into `handle_extra_field*` / `handle_no_extra_fields_error`
  with only the parameters used by each branch.

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 30, 2026
…tors, and flatten

Moves per-field serialization, schema building, missing-field handling, and
destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free
templates parameterized only on each field's type (never the enclosing
`NamedTuple` pack), and skips instantiating destructors for trivially
destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on
wide structs with zero public API changes.

Split from parser-symbol-isolation (#118) into an independent, reviewable chunk
(no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader`
isolation follow in separate commits).

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
Downstream receipts (combined Wave 1 N=3 interleaved medians vs main):
- hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall
- openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall
- FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall
- games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Nov 30, 2026
…WithDefault

Lifts per-field parsing, placement-move, move-assign, error-recording, and
extra-field helpers out of `ViewReader<..., ViewType, ...>` and
`ViewReaderWithDefault<..., ViewType, ...>` into free function templates
parameterized only by each field's type (never the enclosing `ViewType`),
keeping linear field-name dispatch (inline for `size_ <= 4`, out-of-line for
wider structs) and the compile-time positional read fast path.

Parent: depends on `fix(parsing): capture input keys matching ExtraFields member name`
(preserving the `is != ViewType::pos_extra_fields()` guard). Independent of
`NamedTupleParser` helper isolation; wide-struct `FieldNameLookup` follows in
a dedicated child commit.

Judge polish applied:
- Zero `[[maybe_unused]]` annotations (per munich-data-engineering#582): unmatched-name handling
  dispatches directly into `handle_extra_field*` / `handle_no_extra_fields_error`
  with only the parameters used by each branch.

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Dec 1, 2026
…tors, and flatten

Moves per-field serialization, schema building, missing-field handling, and
destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free
templates parameterized only on each field's type (never the enclosing
`NamedTuple` pack), and skips instantiating destructors for trivially
destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on
wide structs with zero public API changes.

Split from parser-symbol-isolation (#118) into an independent, reviewable chunk
(no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader`
isolation follow in separate commits).

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
Downstream receipts (combined Wave 1 N=3 interleaved medians vs main):
- hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall
- openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall
- FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall
- games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Dec 1, 2026
…WithDefault

Lifts per-field parsing, placement-move, move-assign, error-recording, and
extra-field helpers out of `ViewReader<..., ViewType, ...>` and
`ViewReaderWithDefault<..., ViewType, ...>` into free function templates
parameterized only by each field's type (never the enclosing `ViewType`),
keeping linear field-name dispatch (inline for `size_ <= 4`, out-of-line for
wider structs) and the compile-time positional read fast path.

Parent: depends on `fix(parsing): capture input keys matching ExtraFields member name`
(preserving the `is != ViewType::pos_extra_fields()` guard). Independent of
`NamedTupleParser` helper isolation; wide-struct `FieldNameLookup` follows in
a dedicated child commit.

Judge polish applied:
- Zero `[[maybe_unused]]` annotations (per munich-data-engineering#582): unmatched-name handling
  dispatches directly into `handle_extra_field*` / `handle_no_extra_fields_error`
  with only the parameters used by each branch.

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Dec 2, 2026
…tors, and flatten

Moves per-field serialization, schema building, missing-field handling, and
destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free
templates parameterized only on each field's type (never the enclosing
`NamedTuple` pack), and skips instantiating destructors for trivially
destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on
wide structs with zero public API changes.

Split from parser-symbol-isolation (#118) into an independent, reviewable chunk
(no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader`
isolation follow in separate commits).

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
Downstream receipts (combined Wave 1 N=3 interleaved medians vs main):
- hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall
- openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall
- FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall
- games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Dec 2, 2026
…WithDefault

Lifts per-field parsing, placement-move, move-assign, error-recording, and
extra-field helpers out of `ViewReader<..., ViewType, ...>` and
`ViewReaderWithDefault<..., ViewType, ...>` into free function templates
parameterized only by each field's type (never the enclosing `ViewType`),
keeping linear field-name dispatch (inline for `size_ <= 4`, out-of-line for
wider structs) and the compile-time positional read fast path.

Parent: depends on `fix(parsing): capture input keys matching ExtraFields member name`
(preserving the `is != ViewType::pos_extra_fields()` guard). Independent of
`NamedTupleParser` helper isolation; wide-struct `FieldNameLookup` follows in
a dedicated child commit.

Judge polish applied:
- Zero `[[maybe_unused]]` annotations (per munich-data-engineering#582): unmatched-name handling
  dispatches directly into `handle_extra_field*` / `handle_no_extra_fields_error`
  with only the parameters used by each branch.

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
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.

1 participant