Apply micro patches only when building micro
Most users will probably never use micro. No reason to apply their specific patches that may influence or break other things.
Disabling huge pages also negatively affects performance. The others are simply superfluous if not needed.
Most users will probably never use micro.
I don't agree. The SPC binary itself is using micro. Many developers for CLI developing may find to here firstly and already been used widely. The original purpose of this project was to improve the build process of phpmicro.
No reason to apply their specific patches that may influence or break other things.
I agree. Some patches should be used when building with --build-micro only, but I'll leave current SPC_MICRO_PATCHES in current main branch. We could change this env behavior in 3.0.
Disabling huge pages also negatively affects performance.
Indeed. We could remove disable_huge_pages in default ini configs later.
The others are simply superfluous if not needed.
-
cli_checksis necessary for calling many extension functions in micro SAPI properly, keeping it should have no impact. - Windows required patches cannot be removed for php.exe builds.
-
static_opcachewill be used when includingopcacheextension for PHP <= 8.4. -
pharwill be used when building micro withpharextension. -
macos_iconvlooks redundant for now, I'll remove it later.
I would say we keep the patch, but generally change patches to only happen when actually using functionality that requires them. Huge pages amounted to a good ~4% performance and it took me 3 days to find it because I was using the source/php-src folder to configure manually.
To reduce downloading and dependencies, I think we could move micro patches into SPC's source to maintain. StaticPHP uses forked phpmicro, which is actually a completely version we maintaining.
After doing this we can download micro SAPI when building micro.sfx only.
We should only copy over the patches that are required to make php compilation work for cli/fpm/etc. without micro. On linux and macos, none of the patches are required for 8.5. For <= 8.4 we only need static_opcache patch.