Skip to content

perf: inline module hot lookup dispatch - #125

Merged
Qubitium merged 1 commit into
mainfrom
perf/inline-module-hot-lookup
Oct 21, 2026
Merged

Qubitium merged 1 commit into
mainfrom
perf/inline-module-hot-lookup

Conversation

@Qubitium

Copy link
Copy Markdown
Contributor

Inline the already-validated thread-local module hot entry directly into _module_lookup, avoiding a redundant _module_compile call and repeated default-shape checks on module-level match, search, fullmatch, findall, and finditer.

  • Preserve the original _module_compile fallback when it is monkeypatched or a legacy backend is in use.
  • Keep generation, configured-default, thread-default, exact-type, and C-wrapper guards on the hot entry.
  • Add regression coverage that warms the hot entry before swapping in a legacy compile seam.

Local free-threaded benchmark (3.14t): module.match 0.700 -> 0.596 us, module.search 0.705 -> 0.600 us, module.fullmatch 0.736 -> 0.626 us, module.findall 0.632 -> 0.533 us, module.finditer 1.778 -> 1.617 us.

Validation: 908 passed, 14 skipped, 545 subtests; debug-allocator thread/cache suite 83 passed. Version remains 0.6.4.

@Qubitium
Qubitium merged commit 8093a4f into main Oct 21, 2026
19 checks passed
@Qubitium
Qubitium deleted the perf/inline-module-hot-lookup branch October 21, 2026 08:10
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