Repository navigation
Conversation
strip_flatten and StepFile::parse split their input into chunks and, with the new optional step/rayon feature (enabled by triangulate/parallel), process the chunks on the rayon pool. Results are applied in file order, so the output, duplicate-ID handling and the first reported error match the sequential parse. Without the feature (wasm), each input is one chunk. Parsing also avoids per-record overhead: memchr finds entity names, references parse without nom combinators, UTF-8 is checked once per chunk, reference checks use a bitset, and complex entities use a small vector instead of hash maps. A complex entity that omits a supertype is now an invalid record instead of a panic.
StepFile::parse now takes &str and strip_flatten returns String, since flattening already emits only ASCII. This removes the UTF-8 checks and fallbacks from parsing. Records are parsed in chunks and applied in file order, as in the sequential loop. This removes the ID-to-record table, the duplicate-ID and first-error bookkeeping, and the error rescan, with the same result. The generator now boxes entities by estimated payload size instead of attribute count. The 110 records with payloads over 56 bytes are boxed, so every Entity slot is 64 bytes instead of 128, and a compile-time assertion keeps it so.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This change flattens and parses STEP files in chunks on the rayon pool when
triangulate/parallelis on, removes per-record overhead in the parser, and shrinks eachEntitytable slot from 128 to 64 bytes (ENG-3819).StepFile::parsenow takes&strandstrip_flattenreturnsString; callers that pass the flattened output compile without change. On the 154 MB CM4 model, flatten and parse take 0.19 s instead of 1.9 s, and all 948 corpus models give the same entities and meshes as master.