Commit b1cad24
committed
perf: Speed up IN segment condition evaluation
Cache the parsed IN-condition value set via lru_cache on the str path
and use a frozenset for membership checks. Also short-circuit the JSON
parse attempt for values that don't start with "[" — plain comma-
separated strings skip json.loads entirely.
Adds IN-condition contexts (JSON array form, comma-separated, and
native list) to the codspeed benchmark so future changes to IN stay
measured.
beep boop1 parent 6237c31 commit b1cad24
2 files changed
Lines changed: 29 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 282 | + | |
295 | 283 | | |
296 | | - | |
297 | | - | |
298 | | - | |
| 284 | + | |
299 | 285 | | |
300 | 286 | | |
301 | 287 | | |
| |||
348 | 334 | | |
349 | 335 | | |
350 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
351 | 361 | | |
352 | 362 | | |
353 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
0 commit comments