[build] Define ISA extensions for all 1st party code#6093
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
Looks like clang-tidy is getting errors with an intrinsics header when parsing src/workerd/tests/bench-tools.h 🙄 |
We should – @FlorentCollin said that he could write a test for this, the only wrinkle is that it will merely cause a "HashIndex detected hash table inconsistency" warning if there was a regression. In the future, we should have some way to have errors in tests cause an exception instead of just a log, for doing this in capnproto we might add a KJ_DASSERT (that way it would not just affect tests but be limited to debug builds and thus not affect release builds, hopefully good enough). |
9e5dd8f to
d4701f8
Compare
- Ideally we'd enable this on all C/C++ code, but that's difficult (see TODO comment) - This should fix #5977 by ensuring both places where we compute SQL-related hashes use hardware acceleration. To address this more generally, we'll need to make changes in capnp (capnproto/capnproto#2564) - Also fixes a regression where crc-impl.c++ was compiled without CRC extensions enabled, which appears to have caused the software-based CRC32C implementation to be used - Define -O3 properly for perfetto-tracing target on Windows, for consistency
d4701f8 to
f447aa2
Compare
|
Can't we set global copt via Does this change cover the capnp dependency? I think it's important that it be compiled with consistent flags since hash codes could be passed between workerd code and capnp code. |
Unfortunately, we can't do that in a way that works in all edge cases – .bazelrc gives us no way to determine the cpu architecture, so unless we require the user to pass flags like This does not include capnproto – that's why I would prefer to always use the same hash function and fall back to using a software implementation, while having mixed compile flags is not ideal it is something that commonly happens when using precompiled libraries that do not enable ISA extensions beyond the x64 baseline (e.g. in apt packages). We'd want to avoid it, but capnproto should be able to handle it gracefully. |
|
We need to figure out how to compile all of workerd -- including capnproto -- with the same flags. Mixing implementations between translation units is not the right answer, even if they are designed to be equivalent. It's fragile and it's an ODR violation. If we need to just force these flags on in the capnp bazel build, that's better than what we have now. |
We can enable the required flags for all capnproto code by introducing a |
Notes for reviewers: