This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Commit 2ec6ea6
authored
perf: collisions don't contain reserved names by default (#684)
The 'collisions' set does NOT contain RESERVED_NAMES; they are
combined at runtime when needed.
For a large real-world, this results in an order of magnitude
reduction in memory usage.
I'm not joking: Google Ads v5 uses 2.45 GB peak before this change
and 223 MB after.
Also contains changes to add `__slots__` attributes to Metadata and Address. These are ancillary, optional, and open to negotiation.
In the above scenario, they reduce memory usage from 223 MB to 177 MB. If other people feel that the reduction in readability does not warrant the reduction in memory usage I am absolutely open to dropping that particular commit.
Includes other minor memory usage optimizations that collectively shave about 5 MB.1 parent 18425e2 commit 2ec6ea6
2 files changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
117 | | - | |
| 114 | + | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
| |||
283 | 280 | | |
284 | 281 | | |
285 | 282 | | |
286 | | - | |
| 283 | + | |
287 | 284 | | |
288 | 285 | | |
289 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
| 317 | + | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
| |||
1060 | 1066 | | |
1061 | 1067 | | |
1062 | 1068 | | |
1063 | | - | |
| 1069 | + | |
1064 | 1070 | | |
1065 | 1071 | | |
1066 | 1072 | | |
| |||
0 commit comments