Codeflash / json_repair#113
⚡️ Speed up method ObjectComparer.is_same_object by 109%
BLOCK
The “faster” code does up to 363× the work on valid inputs, growing with input size (complexity regression).
Performance · ObjectComparer.is_same_object
Worst family with mostly valid inputs: 363.31× the instructions of base (swap position of the mismatched key within dict ordering).
- R1
- R2
- R3
- R4
- F4
| Family | Inputs | Ratio range | Slope base → head | Verdict |
|---|---|---|---|---|
R1 | large dicts with identical length but one key swapped, and deep equal values on the shared keyssuspected slowdown · archive | 1.26× – 160.06× | 0.31 → 1.08 | complexity-regression |
R2 | swap position of the mismatched key within dict orderingsuspected slowdown · archive | 0.36× – 363.31× | 0.34 → 1.08 | complexity-regression |
R3 | Large dictionaries with same length but almost no common keyssuspected slowdown · archive | 0.64× – 3.73× | 0.74 → 0.95 | complexity-regression |
R4 | Dicts with numeric string keys where only the first matchessuspected slowdown · archive | 0.36× – 3.39× | 0.77 → 0.92 | complexity-regression |
F4 | large flat listsclaimed speedup · plan | 0.56× – 0.58× | 0.89 → 0.89 | faster |
Receipt
| Target | Backend | Image | Run | Audit | Adjudication |
|---|---|---|---|---|---|
json_repair.object_comparer:ObjectComparer.is_same_object | Token Factory Sandboxes | 44ce7ab3-2490-4df1-96bc-08c7d76584d1 | bt-json_repair#113-ba5cd1 | $0.23 | $0.000 |
Nemotron cost on Nebius Token Factory. Backend: where the untrusted code ran. Token Factory Sandboxes (a microVM branched from a kept image, cited by its UUID). Every image is content-addressed (repo at each commit + harness), so every card re-runs from the image and seed 0. Raw data: audit.