)]}'
{
  "commit": "84a20bdbf993d6eb1bdfa9d4e5d26d7096a241db",
  "tree": "d53939b20adf4fb152f83910c6611119c48e0c6e",
  "parents": [
    "52de0c739d2f066ea06fa9a886bc8fcc9fa079c6"
  ],
  "author": {
    "name": "Vaggelis Danias",
    "email": "daniasevangelos@gmail.com",
    "time": "Thu Jun 04 14:50:49 2026 +0300"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Jun 04 13:50:49 2026 +0200"
  },
  "message": "[mypyc] Specialize `s[i] \u003d\u003d \u0027x\u0027` to a codepoint int compare (#21579)\n\n7th PR of #21418\n\nLowers `s[i] \u003d\u003d \u0027x\u0027` (and the symmetric `\u003d\u003d` / `!\u003d` forms) down to a\nbounds-checked codepoint read + int compare, instead of `CPyStr_GetItem`\n+ `CPyStr_EqualLiteral` which (may) allocate a 1-character `PyUnicode`\nper iteration. No annotations are required for this optimization.\n\nOn microbenchmarks (1-compare-per-iter hot loop, ~2.5M-codepoint\nSQL-like string) the comparison is ~3.6x times faster.\n\n\u003cbr /\u003e\n\nSome follow up optimizations that might be worth it I can work on:\n- In operator e.g `s[i] in (\u0027a\u0027, \u0027b\u0027, \u0027c\u0027)` --\u003e Fuse to one check with N\nint comparisons\n- Comparison operators e.g `s[i] \u003c \u0027x\u0027` --\u003e Need to expand the op set\n - `s[i] \u003d\u003d s[j]` --\u003e Need drop the literal-only guard",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e8d22a051cc4d69e314183ff5ed8b9c52b0b43d4",
      "old_mode": 33188,
      "old_path": "mypyc/irbuild/expression.py",
      "new_id": "f953dd3825ef286a09d88855d4aaf441a970673c",
      "new_mode": 33188,
      "new_path": "mypyc/irbuild/expression.py"
    },
    {
      "type": "modify",
      "old_id": "81cd5bd34c0466be48612835c97062910270fc42",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/irbuild-str.test",
      "new_id": "b16057f645ba7fed3a3686e651c215ebfae6d27f",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/irbuild-str.test"
    },
    {
      "type": "modify",
      "old_id": "ec662da969865cbec3cb7d203191542466af8cf9",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/run-strings.test",
      "new_id": "81b85580d7a7b21aa6f8ca848fc3b0d6e0c8e4ec",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/run-strings.test"
    }
  ]
}
