Skip to content

Tune cache#73

Merged
Qubitium merged 2 commits into
mainfrom
tune
Mar 9, 2026
Merged

Tune cache#73
Qubitium merged 2 commits into
mainfrom
tune

Conversation

@Qubitium

@Qubitium Qubitium commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

| Case | A ns/call | B ns/call | Delta ns | Speedup |
+--------------------+-----------+-----------+-----------+---------+
| ext_compile_cached | 264.1 | 172.9 | -91.2 | 1.53x |
| ext_match_module | 454.0 | 351.3 | -102.7 | 1.29x |
+--------------------+-----------+-----------+-----------+---------+

Qubitium added 2 commits March 8, 2026 06:18
  | Case               | A ns/call | B ns/call | Delta ns  | Speedup |
  +--------------------+-----------+-----------+-----------+---------+
  | ext_compile_cached | 264.1     | 172.9     | -91.2     | 1.53x   |
  | ext_match_module   | 454.0     | 351.3     | -102.7    | 1.29x   |
  +--------------------+-----------+-----------+-----------+---------+
@Qubitium

Qubitium commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Measured impact (A=before, B=after): zen3

  • compile_cached_default: 1749.2 ns -> 693.4 ns (2.52x)
  • match_module_default: 3750.7 ns -> 2553.9 ns (1.47x)
  • ext_compile_cached: 264.1 ns -> 172.9 ns (1.53x)
  • ext_match_module: 454.0 ns -> 351.3 ns (1.29x)

@Qubitium

Qubitium commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

A = pre-optimization baseline (reverted in isolated /tmp sandbox)
B = current optimized code
Metric = best ns/call (lower is better), 7 repeats.

+----------------------+-----------+-----------+---------+-----------+
| Scenario | A ns/call | B ns/call | Speedup | Improvement|
+----------------------+-----------+-----------+---------+-----------+
| compiled_match | 1379.0 | 1364.6 | 1.01x | 1.04% |
| compiled_search_long | 1456.6 | 1453.3 | 1.00x | 0.23% |
| compiled_findall | 40644.7 | 40250.0 | 1.01x | 0.97% |
| module_match_cached | 3432.8 | 2147.3 | 1.60x | 37.45% |
| module_match_uncached| 3593.8 | 2428.9 | 1.48x | 32.41% |
+----------------------+-----------+-----------+---------+-----------+

Summary:

  • Compiled regex execution (pattern precompiled, only matching): about ~1% faster (effectively flat).
  • Non-compiled/module-level execution (pcre.match(...) style): about 1.48x–1.60x faster (~32–37%).

@Qubitium
Qubitium merged commit 12dc2fc into main Mar 9, 2026
127 of 149 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant