Repository navigation
Conversation
Use integer cell-type indices for interaction rates, immunogenicity, and spring attachment affinity. The heterogeneity benchmark shows 13.18% fewer CPU cycles and 13.03% lower elapsed time across five runs. Numerical outputs are bit-identical to baseline in both heterogeneity and celltypes3 examples. Co-authored-by: ChatGPT <chatgpt@openai.com>
drbergman
approved these changes
Oct 22, 2026
drbergman
left a comment
Collaborator
There was a problem hiding this comment.
Looks like a clean set of changes with a modest performance gain. In my own ad hoc testing, I saw a ~5% speedup on heterogeneity (edits: max time = 90min, #threads = 1).
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.
Summary
Replace repeated string-based cell-type lookups with integer-indexed
accesses in:
The changes use the existing cell_definition_indices_by_type registry
and directly access the corresponding parameter vectors.
No floating-point arithmetic is changed.
Performance
Measured with perf stat -r 5 -e cycles:u on the heterogeneity example.
Single OpenMP thread, GCC -O3 -march=native.
Numerical validation
Both original and optimized versions produced byte-for-byte identical:
Verified in two examples:
The celltypes3 simulation contained 130 neighbor links,
including 90 links between different cell types.
All comparisons passed.