Skip to content

Tune Linux native build flags and xxhash compilation#41

Merged
yawkat merged 1 commit intomainfrom
perf/native-build-tuning
Mar 2, 2026
Merged

Tune Linux native build flags and xxhash compilation#41
yawkat merged 1 commit intomainfrom
perf/native-build-tuning

Conversation

@yawkat
Copy link
Owner

@yawkat yawkat commented Mar 2, 2026

Summary

  • switch Linux JNI build from one-shot compile/link to per-source object compilation in pom.xml, with distro-like default Linux CFLAGS and a dedicated native.xxhash.cflags property
  • compile xxhash.c with -fno-tree-vectorize by default on Linux and keep all flags overridable via -Dnative.*
  • reduce workflow duplication by centralizing common Linux flags in job-level env vars and using per-arch deltas only in the matrix

Validation

  • ./mvnw -q verify passed
  • benchmarked bundled at.yawk.lz4:lz4-java:1.10.1 vs this branch's freshly built native lib (-Djava.library.path=target/classes/net/jpountz/util/linux/amd64) on pinned core:
    • STREAM32K (283 MiB TPCDS-like): 296.07 MiB/s -> 321.01 MiB/s (~+8.4%)
    • HASH32_BLOCK32K: 3391.17 MiB/s -> 6114.35 MiB/s (~+80.3%)

Notes

  • perf guard benchmark intentionally not added per request

@yawkat
Copy link
Owner Author

yawkat commented Mar 2, 2026

Note: This is an AI-generated PR to attempt to fix the performance regression in #30. I asked the agent to adapt flags to better match distro lz4 builds, and to measure the performance impact.

@yawkat yawkat linked an issue Mar 2, 2026 that may be closed by this pull request
@yawkat yawkat merged commit f659131 into main Mar 2, 2026
2 checks passed
@yawkat yawkat deleted the perf/native-build-tuning branch March 2, 2026 16:42
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

🚀 Preview deployed to https://7d0c5bcd.lz4-java-yawk-at.pages.dev

@yawkat
Copy link
Owner Author

yawkat commented Mar 2, 2026

Hmm still some issues, I forgot that the cross-platform build needs to be triggered manually

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.

Performance drop after upgrading from 1.8.0 to 1.10.1

1 participant