Skip to content

perf: give the image the gmp its base conversions keep asking for - #742

Merged
lens0021 merged 1 commit into
mainfrom
claude/gmp
Sep 10, 2026
Merged

lens0021 merged 1 commit into
mainfrom
claude/gmp

Conversation

@lens0021

Copy link
Copy Markdown
Collaborator

Wikimedia\base_convert uses gmp when it is there, bcmath when it is not, and a long division written in PHP when neither is. The image has neither: the base image builds calendar, intl, mbstring, mysqli and opcache, which is what a wiki serving readers needs.

A bake asks for base conversion constantly. LockManager names every file lock by a sha1 in base 36, and GlobalIdGenerator converts every id it hands out.

Measured

Four bakes, alternating, the same PHP with the extension loaded and not:

without with
the whole bake 132.2 / 130.7s 128.5 / 128.1s
build the translations 79.1 / 78.6s 77.8 / 76.5s
render the skins 27.0 / 27.5s 26.4 / 26.1s

About 3.1 seconds, near 2.4%. Both exports in each pair were the same tree, 803 files.

Not the binary

Its PHP already carries bcmath, so it takes the middle path rather than the slow one, and gmp would still be faster. But libgmp is LGPL-3.0-or-later / GPL-2.0-or-later, and the binary links its libraries statically — which is a different question from the image, where the extension loads a shared library the image also ships. Given that Vulcain is already left out of the binary over its licence, that call is yours rather than mine; say the word and it is a one-word change to binary.Dockerfile.

Refs #740.

🤖 Generated with Claude Code

https://claude.ai/code/session_019ghEx26MRm9V5CnCLrdUQn


Generated by Claude Code

Without gmp, Wikimedia\base_convert is long division written in PHP, and a bake runs it for every
file lock and every generated id. Building the extension into the image is worth about two percent
of a bake, and the export does not change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ghEx26MRm9V5CnCLrdUQn
@github-actions
github-actions Bot temporarily deployed to preview September 10, 2026 01:31 Destroyed
@lens0021
lens0021 merged commit 16e8f39 into main Sep 10, 2026
29 checks passed
@lens0021
lens0021 deleted the claude/gmp branch September 10, 2026 04:33
lens0021 pushed a commit that referenced this pull request Sep 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.1.0](v1.0.0...v1.1.0)
(2026-09-20)


### Features

* have a bake say where its time went
([#719](#719))
([d9d56e5](d9d56e5))
* have serve say where the site it is serving can be read
([#733](#733))
([b1c42da](b1c42da))
* have the binary introduce itself rather than Caddy
([#734](#734))
([fd4d889](fd4d889))
* let a bake keep the extensions and skins it fetched
([#723](#723))
([ec65354](ec65354))
* let a site say where it will be published
([#621](#621))
([6e458fd](6e458fd))
* let WikvenFailOnCategories name the categories a build must find no
page in ([#661](#661))
([89d4726](89d4726))
* name the server a binary build ran on, on the licenses page
([#617](#617))
([d68b969](d68b969))
* refuse a translation carrying a tag that belongs to its source page
([#675](#675))
([d0bfe72](d0bfe72))
* say which address a page is published at, and where its translations
are ([#658](#658))
([002260c](002260c))
* write a sitemap for a site that says where it is published
([#623](#623))
([b0ad0a1](b0ad0a1))


### Bugfixes

* answer a caller that asked for a whole URL with one
([#630](#630))
([effaada](effaada))
* answer a change to an English page in English alone
([#715](#715))
([7d2bc8e](7d2bc8e))
* give a picture named in a page's metadata an address that resolves
([#648](#648))
([a2c3b32](a2c3b32))
* give the settings page the sentence written for it
([#753](#753))
([6615b96](6615b96))
* let a picture named in a page's head be told from one in its body
([#671](#671))
([2aa57ca](2aa57ca))
* let Citizen's preferences panel keep its own spacing
([#708](#708))
([904775d](904775d))
* let the downloaded tarball go when the fetch does not
([#695](#695))
([0595e40](0595e40))
* measure a sitemap against both the caps it has to be inside
([#669](#669))
([a12295f](a12295f))
* report a run the standalone binary's build died in
([#665](#665))
([6f77af3](6f77af3))
* stop handing a reader the address of the machine that built the site
([#638](#638))
([eac411d](eac411d))
* stop loading skins the site never asked for
([#662](#662))
([99a8f9b](99a8f9b))
* stop shipping a Caddy module wikven cannot use
([#619](#619))
([e186a3d](e186a3d))
* stop the preview answering for an address the site does not have
([#650](#650))
([18e6b01](18e6b01))
* stop the translation drain spinning on a queue that gives nothing
([#739](#739))
([b93aeef](b93aeef))
* tell a source editor only about translations that fail the check
([#718](#718))
([38d5640](38d5640))
* wait for the page before filling in the skins section
([#649](#649))
([d615e2a](d615e2a))


### Performance

* give the image the gmp its base conversions keep asking for
([#742](#742))
([16e8f39](16e8f39))
* keep the job queue on the database the build already has open
([#736](#736))
([5b79453](5b79453))
* let a bake's boots share what the first one compiled
([#741](#741))
([bfb9a14](bfb9a14))
* let the binary's bake share its compiled PHP too
([#743](#743))
([228d783](228d783))
* let the wiki's own database sync the way the three beside it do
([#725](#725))
([bb7a8d2](bb7a8d2))
* offer Translate only the languages the source is written in
([#730](#730))
([fd74048](fd74048))
* parse the pages beside each other before importing them
([#728](#728))
([619fb47](619fb47))
* spare the translation units a description they will never show
([#737](#737))
([cd45597](cd45597))
* stop purging a cache a bake does not have
([#735](#735))
([bcbb842](bcbb842))
* stop rebuilding translation stats a bake goes on to recompute
([#722](#722))
([500cb23](500cb23))
* stop rendering translation pages the build renders again
([#729](#729))
([e3d40d4](e3d40d4))
* stop running two jobs a static export has no reader for
([#726](#726))
([c866061](c866061))
* tag the base page ready without writing it again
([#738](#738))
([b672785](b672785))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This was referenced Sep 20, 2026
This was referenced Oct 2, 2026

This branch was successfully deployed

No deployments
preview — 82221d69 Deployed Sep 10, 2026 by github-actions[bot]
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