Skip to content

Conversation

Yoav11
Copy link
Owner

@Yoav11 Yoav11 commented Aug 13, 2025

Description

small test to bechmark ImportError_repr's alternative implementations as requested per python#136770 (comment)

How to run ?

  1. uncomment the implementation you want to benchmark in exceptions.c (comment the other one)
  2. build cpython (e.g run make)
  3. run ./python.exe -m test test_exceptions -m ImportErrorBenchmark -v , the benchmark result should appear as a stdout print.

Results

as run on my m2 macbook pro:

PyUnicodeWriter implementation: Total time for creating ImportError: 1.9643223330 seconds

Alternative implementation: Total time for creating ImportError: 2.4935530830 seconds

@Yoav11 Yoav11 closed this Aug 18, 2025
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.

2 participants