Skip to content

Conversation

@radik878
Copy link
Contributor

@radik878 radik878 commented Nov 5, 2025

Precompute prime_bigint, half_prime, 2^40, and 2^100 once per request in get_data() to avoid per-element parsing and exponentiation.
Refactor field_element_repr() to accept precomputed constants by reference, removing unnecessary clone()s and repeated BigInt computations.
Rationale: Reduce CPU and allocations when mapping memory values to strings for the tracer API, leveraging existing cached CAIRO_PRIME.

@gabrielbosio
Copy link
Collaborator

Hi, @radik878! Do you have any benchmark that shows any improvement? If so, please share the results

@radik878
Copy link
Contributor Author

radik878 commented Nov 7, 2025

Before:
image
image

and after:
image
image
image
image

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