Commit 6441197
Modest cleanup of ensure_independent_atom_ids.
Inlines the nested independent_ids() closure so the unique-IDs
check is part of the function body. Microbenchmarks show ~6%
speedup on a typical 2-species/10-atoms case (3.6us -> 3.4us)
but the real value is readability: one less function definition
and one less call per invocation (it's called ~115K times in
the catalytic profile).
Also collapses the slow-path's two list comprehensions over
species.molecule (one filtering reactive, one filtering not
reactive) into a single pass that splits into two lists.
The bigger time sink in this code path is actually
filter_structures and its deepcopy fanout (cumtime ~105s in
the same profile vs ~242s self-time for this function);
that's a separate target.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b547b09 commit 6441197
1 file changed
Lines changed: 17 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
210 | 208 | | |
211 | | - | |
212 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | | - | |
219 | | - | |
| 219 | + | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| |||
0 commit comments