Skip to content

ext/gmp: Use fast ZPP for several remaining functions - #24469

Closed
LamentXU123 wants to merge 1 commit into
php:masterfrom
LamentXU123:gmpzpp
Closed

LamentXU123 wants to merge 1 commit into
php:masterfrom
LamentXU123:gmpzpp

Conversation

@LamentXU123

@LamentXU123 LamentXU123 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Follow-up 9ee1265

@Girgias

Girgias commented Oct 23, 2026

Copy link
Copy Markdown
Member

The main reason I had converted those to fast ZPP was to migrate them to use a custom fast ZPP specifier.

There is no need here.

@LamentXU123

LamentXU123 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member Author

Ain't fast ZPP (slightly) faster and more readable?

@Girgias

Girgias commented Oct 23, 2026

Copy link
Copy Markdown
Member

At the cost of increased binaries as the whole logic is duplicated. I really don't have any strong opinions here.

@LamentXU123

LamentXU123 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member Author

Some function like gmp_random_bits isn't taking much time to run itself esp when the argument is small. The ZPP stuff here can cause improvements. e.g. my local bench shows gmp_random_bits(1) ~17.4% less runtime.
The binary increase of all of them is only ~1KB which is argueably big tho..

@LamentXU123

Copy link
Copy Markdown
Member Author

Okay I am closing this as the trade-off is not obvious,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants