Comments (9)
I am concerned that running on a wrong CPU would cause very unpredictable undefined behavior silently. Or are we confident that machines that do not support AVX2 will generate garbage output before it actually runs something in production to cause some damage?
What about we provide AVX2 binaries separately first and detect that we can use these binaries in install.sh?
from php-binaries.
Attempted usage of AVX2 instructions will cause an immediate crash with SIGILL since the host processor won't recognize the instruction.
In any case, as it turns out, some stuff such as libdeflate already compiles AVX2 code anyway, and uses cpuid()
to switch the used function at runtime depending on what features the processor supports, so this isn't as big of a deal as I expected.
from php-binaries.
Attempted usage of AVX2 instructions will cause an immediate crash with SIGILL since the host processor won't recognize the instruction.
This is not exactly true. Other CPU models may interpret the same instruction code as something else and treat it differently.
from php-binaries.
I hadn't considered that, but since we're dealing with only two x86_64 vendors with known histories (AMD and Intel), I think that's probably not a concern.
from php-binaries.
I am not very familiar with various SIMD instruction sets, but it appears that AVX2 is already common enough. It is probably still a good idea for users to compile their own binaries to get the best performance though.
from php-binaries.
I think currently most people aren't aware that they are sacrificing performance by using prebuilt binaries instead of compiling their own, especially since installing a prebuilt is recommended by the docs, and is also done automatically by installer.sh.
from php-binaries.
(Binaries built using compile.sh without the -t flag will automatically use -march=native, so anyone building their own binaries automatically gets the best performance.)
Recently I've added this flag to my fork) I think I'll upload it this week..
from php-binaries.
-march=native makes binaries non-portable. There's a reason we don't use it for the prebuilts.
from php-binaries.
I think if someone could add detecting support of avx2 in runtime of already builded binary than enabling avx2 in prebuils will be good idea.
from php-binaries.
Related Issues (20)
- Stop using insecure connections for downloading code HOT 1
- compile.sh -P option does not work HOT 1
- I can't compile php in Termux. HOT 4
- compile.sh arm64 didnt work HOT 5
- Explore using OpenMP for loop parallelization
- Enable optimizations by default HOT 1
- GitHub's version tag prefix autocheck for compile script HOT 3
- php/8.2 branch still accessing gmplib.org HOT 1
- Error when compile PHP (GMP lib) HOT 1
- php compilation fails on android build HOT 7
- JIT status HOT 1
- MacOS "debugging symbols" don't actually include any DWARF
- Incorrect time zone detection HOT 1
- Jit doesn't work HOT 1
- One try: Pack pmmp into a single file
- RE error: illegal byte sequence HOT 10
- /usr/local/include preferred above all -isystem entries by MacOS clang HOT 1
- Opcache crashes with 0xC0000005 in loop extends HOT 1
- converting to android-aarch64 not working HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-binaries.