Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error on Windows 11 (and Github actions) when using libz-ng-sys 1.1.20 #225

Open
puffyCid opened this issue Oct 28, 2024 · 10 comments

Comments

@puffyCid
Copy link

👋 Hello I am getting an odd compile error when trying version 1.1.20 for libz-ng-sys. I was updating dependencies for my project. I ran cargo update which updated libz-ng-sys to 1.1.20. When I then tried to compile my project I get the error below on Windows:

= note: LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
          liblibz_ng_sys-cff43ade2a43af17.rlib(zutil.obj) : error LNK2019: unresolved external symbol __imp__aligned_free referenced in function zng_free
          liblibz_ng_sys-cff43ade2a43af17.rlib(zutil.obj) : error LNK2019: unresolved external symbol __imp__aligned_malloc referenced in function zng_alloc
          liblibz_ng_sys-cff43ade2a43af17.rlib(slide_hash_sse2.obj) : error LNK2019: unresolved external symbol __imp__wassert referenced in function slide_hash_sse2
          liblibz_ng_sys-cff43ade2a43af17.rlib(crc32_pclmulqdq.obj) : error LNK2001: unresolved external symbol __imp__wassert
          liblibz_ng_sys-cff43ade2a43af17.rlib(crc32_vpclmulqdq.obj) : error LNK2001: unresolved external symbol __imp__wassert
          C:\Users\bob\Projects\artemis\target\release\deps\artemis_server-7e7883e1c1704562.exe : fatal error LNK1120: 3 unresolved externals

I downgraded back to version 1.1.16 and my project compiles fine again. I use flate2-rs in my project and I noticed it still uses 1.1.16. So this may be an issue of using cargo update too hastily?

I just wanted to check if I need to install another dependency similar to cmake?
Let me know if more info is required

@Byron
Copy link
Member

Byron commented Oct 28, 2024

Thanks for reporting.

I use flate2-rs in my project and I noticed it still uses 1.1.16. So this may be an issue of using cargo update too hastily?

The dependency specification in Cargo.toml of flate2-rs would allow for an automatic update with cargo update. I tried to update the dependencies as well and it seemed to work fine for me. Also did the updated version pass all tests on CI which include Windows.
So I'd think it's not a general issue.

Did you try to cargo clean beforehand?

Otherwise, the changes between the versions don't show anything obvious to me that could be causing these missing symbols: __imp__wassert, __imp__aligned_malloc, __imp__aligned_free.

@puffyCid
Copy link
Author

So I tried: cargo clean i still get the error sadly.
the actual error code is: error: linking with link.exe failed: exit code: 1120

I also tried on a separate Windows 10 VM and get the same issue. And as mentioned I get the same error when running the default Windows Github actions runner

@Byron
Copy link
Member

Byron commented Oct 29, 2024

I also tried on a separate Windows 10 VM and get the same issue. And as mentioned I get the same error when running the default Windows Github actions runner

That's interesting! Could you minimize and contribute this setup? I think if that would happen here a release could have been prevented.

And yes, the link error is due to the missing symbols, they look a bit strange and are very basic, maybe they have been renamed somehow. By default, compilation succeeds though, the CI here works fine, so maybe there is more to the particular setup needed to trigger the issue.

PS: If you could share the project/code I could try to compile it on my machine, maybe it's a similar issue there.

@puffyCid
Copy link
Author

puffyCid commented Oct 30, 2024

The project repo - https://github.com/puffyCid/artemis

  • There are two workspaces that use flate2 crate: core and server.
  • error only seems to occur in the server workspace

GitHub Actions Windows runner failure - https://github.com/puffyCid/artemis/actions/runs/11547850661/job/32138376614

As look at it more, I think this may be related to one of my tests or something. Cargo is able to build the project fine via cargo build
But if i run cargo test --release I get the compile error. So this probably something wrong a test or another dependency/config maybe.

I will continue to investigate, but if you like to try to compiling the project, the server workspace does require some additional tools besides Rust:

  • just command runner
  • trunk to compile WASM
  • npm for tailwindcss

If you clone the repo there a just command that can be used that should be able to setup everything on a Windows system. The only requirement is that rust, just, and chocolatey are already installed
The automated setup should install everything need to compile/build. It will also install a few cargo plugins too. If u dont want that, reviewing the just files themselves should show all the commands that need to be run

Steps to reproduce issue

  1. Clone repo https://github.com/puffyCid/artemis
  2. Run cargo update to ensure libz-ng-sys is 1.1.20
  3. Run just --shell pwsh.exe --shell-arg -c setup-windows to install all required dependencies such as trunk, node, cmake, etc
  4. Run just --shell pwsh.exe --shell-arg -c build to compile the project. This seems to work ok
  5. Run just --shell pwsh.exe --shell-arg -c test or just --shell pwsh.exe --shell-arg -c eventlogs to trigger the compile error

@Byron
Copy link
Member

Byron commented Oct 30, 2024

After building just the WASM part which gets done after running just I was able to run tests via cargo test --release without linking problems.

warning: `artemis-server` (lib test) generated 2 warnings (2 duplicates)
warning: `core` (lib test) generated 4 warnings (3 duplicates)
    Finished `release` profile [optimized] target(s) in 33.01s
     Running unittests src/main.rs (target/release/deps/artemis-0d3cc7d5ded5d1e0)

running 20 tests
test collector::system::tests::test_run_collector_eventlogs ... ok
test collector::system::tests::test_run_collector_bits ... ok
test collector::system::tests::test_run_collector_rawfiles ... ok
test collector::system::tests::test_run_collector_prefetch ... ok
test collector::system::tests::test_run_collector_srum ... ok
test collector::system::tests::test_setup_artifact ... ok
test collector::system::tests::test_run_collector_shellbags ... ok
test collector::system::tests::test_setup_artifact_windows ... ok
test collector::system::tests::test_run_collector_reg ... ok
test tests::test_parse_args_js ... ok
test tests::test_parse_args_toml ... ok
test collector::system::tests::test_run_collector_alts ... ok
test tests::test_parse_args_command_macos ... ok
test collector::system::tests::test_run_collector_files ... ok
test collector::system::tests::test_run_linux_collector_others ... ok
test collector::system::tests::test_run_collector_spotlight ... ok
test tests::test_parse_args_decode ... ok
test collector::system::tests::test_run_collector_proc ... ok
^C

artemis ( main) took 44s

So it seems to be something Windows specific.

Here is my Cargo.lock after the update.

diff --git a/Cargo.lock b/Cargo.lock
index 96953d8..1bc25f4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2126,9 +2126,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
 
 [[package]]
 name = "futures-lite"
-version = "2.3.0"
+version = "2.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
+checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210"
 dependencies = [
  "fastrand",
  "futures-core",
@@ -2625,9 +2625,9 @@ dependencies = [
 
 [[package]]
 name = "hyper-util"
-version = "0.1.9"
+version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b"
+checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4"
 dependencies = [
  "bytes",
  "futures-channel",
@@ -3119,9 +3119,9 @@ dependencies = [
 
 [[package]]
 name = "libm"
-version = "0.2.9"
+version = "0.2.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3bda4c6077b0b08da2c48b172195795498381a7c8988c9e6212a6c55c5b9bd70"
+checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
 
 [[package]]
 name = "libredox"
@@ -3146,9 +3146,9 @@ dependencies = [
 
 [[package]]
 name = "libz-ng-sys"
-version = "1.1.16"
+version = "1.1.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4436751a01da56f1277f323c80d584ffad94a3d14aecd959dd0dff75aa73a438"
+checksum = "8f0f7295a34685977acb2e8cc8b08ee4a8dffd6cf278eeccddbe1ed55ba815d5"
 dependencies = [
  "cmake",
  "libc",
@@ -4450,9 +4450,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
 
 [[package]]
 name = "reqwest"
-version = "0.12.8"
+version = "0.12.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b"
+checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f"
 dependencies = [
  "base64 0.22.1",
  "bytes",
@@ -4678,9 +4678,9 @@ dependencies = [
 
 [[package]]
 name = "rustls"
-version = "0.23.15"
+version = "0.23.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993"
+checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e"
 dependencies = [
  "once_cell",
  "rustls-pki-types",
@@ -4857,9 +4857,9 @@ dependencies = [
 
 [[package]]
 name = "serde"
-version = "1.0.213"
+version = "1.0.214"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1"
+checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5"
 dependencies = [
  "serde_derive",
 ]
@@ -4877,9 +4877,9 @@ dependencies = [
 
 [[package]]
 name = "serde_derive"
-version = "1.0.213"
+version = "1.0.214"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5"
+checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766"
 dependencies = [
  "proc-macro2",
  "quote",

@puffyCid
Copy link
Author

Understood thanks for checking
I will troubleshoot my windows system

Thanks!
I will close this issue since the problem appears to be local

@charliermarsh
Copy link

For reference, we're seeing the same thing in uv, though I haven't had a chance to debug it yet: https://github.com/astral-sh/uv/actions/runs/11598373662/job/32295408945?pr=8703#step:6:194

@git-g00d
Copy link

@Byron, I have this same issue as well. Here's an example project where it happens: https://github.com/git-g00d/zip-test/tree/main. The project is set to use v1.1.20 by default and will fail to compile like others mentioned. If you set the lib-ng-sys version to "=1.1.16" in the Cargo.toml, it compiles without issue. Also, if you force statically linking to the C runtime for Windows, which @puffyCid has in their project's ./cargo/config.toml, then lib-ng-sys will fail to compile when using v1.1.20. If you remove this static linking, then the code compiles successfully.

As a side note, if you build for release, you'll get the 3 or so errors that @puffyCid mentioned:

  = note: LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
          liblibz_ng_sys-cec9647015e6ff87.rlib(zutil.obj) : error LNK2019: unresolved external symbol __imp__aligned_free referenced in function zng_zcfree
          liblibz_ng_sys-cec9647015e6ff87.rlib(zutil.obj) : error LNK2019: unresolved external symbol __imp__aligned_malloc referenced in function zng_zcalloc
          liblibz_ng_sys-cec9647015e6ff87.rlib(slide_hash_sse2.obj) : error LNK2019: unresolved external symbol __imp__wassert referenced in function slide_hash_sse2
          liblibz_ng_sys-cec9647015e6ff87.rlib(crc32_pclmulqdq.obj) : error LNK2001: unresolved external symbol __imp__wassert
          liblibz_ng_sys-cec9647015e6ff87.rlib(crc32_vpclmulqdq.obj) : error LNK2001: unresolved external symbol __imp__wassert
          C:\Users\aaron\projects\zip-test\target\release\deps\zip_test.exe : fatal error LNK1120: 3 unresolved externals

And if building for debug, you get another error (4 in total) and a lot more warnings:

  = note: LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(chunkset_avx2.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_rle.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_huff.obj)'
          LINK : warning LNK4217: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(chunkset_sse2.obj)' in function 'inflate_fast_sse2'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(chunkset_ssse3.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_medium.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_slow.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(zutil.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(trees.obj)'
          LINK : warning LNK4217: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate.obj)' in function 'zng_flush_pending'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(inflate.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_fast.obj)'
          LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_quick.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(chunkset_avx2.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_rle.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_huff.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(chunkset_sse2.obj)'
          LINK : warning LNK4217: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(chunkset_ssse3.obj)' in function 'inflate_fast_ssse3'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_medium.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_slow.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(zutil.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(trees.obj)'
          LINK : warning LNK4217: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate.obj)' in function 'fprintf'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(inflate.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_fast.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_quick.obj)'
          LINK : warning LNK4217: symbol 'putc' defined in 'libucrt.lib(fputc.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_rle.obj)' in function 'deflate_rle'
          LINK : warning LNK4217: symbol 'putc' defined in 'libucrt.lib(fputc.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_fast.obj)' in function 'deflate_fast'
          LINK : warning LNK4286: symbol 'putc' defined in 'libucrt.lib(fputc.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_quick.obj)'
          LINK : warning LNK4286: symbol 'putc' defined in 'libucrt.lib(fputc.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_medium.obj)'
          LINK : warning LNK4286: symbol 'putc' defined in 'libucrt.lib(fputc.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_slow.obj)'
          LINK : warning LNK4217: symbol 'exit' defined in 'libucrt.lib(exit.obj)' is imported by 'liblibz_ng_sys-429ddc65aabd7b0e.rlib(zutil.obj)' in function 'z_error'
          liblibz_ng_sys-429ddc65aabd7b0e.rlib(deflate_quick.obj) : error LNK2019: unresolved external symbol __imp_isgraph referenced in function deflate_quick
          liblibz_ng_sys-429ddc65aabd7b0e.rlib(trees.obj) : error LNK2001: unresolved external symbol __imp_isgraph
          liblibz_ng_sys-429ddc65aabd7b0e.rlib(zutil.obj) : error LNK2019: unresolved external symbol __imp__aligned_free referenced in function zng_zcfree
          liblibz_ng_sys-429ddc65aabd7b0e.rlib(zutil.obj) : error LNK2019: unresolved external symbol __imp__aligned_malloc referenced in function zng_zcalloc
          liblibz_ng_sys-429ddc65aabd7b0e.rlib(slide_hash_sse2.obj) : error LNK2019: unresolved external symbol __imp__wassert referenced in function slide_hash_sse2
          liblibz_ng_sys-429ddc65aabd7b0e.rlib(crc32_pclmulqdq.obj) : error LNK2001: unresolved external symbol __imp__wassert
          liblibz_ng_sys-429ddc65aabd7b0e.rlib(crc32_vpclmulqdq.obj) : error LNK2001: unresolved external symbol __imp__wassert
          C:\Users\aaron\projects\zip-test\target\debug\deps\zip_test.exe : fatal error LNK1120: 4 unresolved externals

If you cannot reproduce the things I have mentioned with the zip-test project, then let me know and I'll be happy to help.

@Byron
Copy link
Member

Byron commented Nov 1, 2024

Thanks for researching this! I hear that when compiling with static CRT on Windows one will see these results.

Once again, the changes between the two releases only indicate relevant changes in zlib-ng, for all I can tell, so that's probably where the breakage was introduced.

Maybe you would be able to reproduce the issue in their test-suite by trying to add the static-CRT flag, and from there I'd think a fix should be doable upstream. Of course, the same could be done here if you think the problem was introduced here.

@git-g00d
Copy link

git-g00d commented Nov 1, 2024

Ah, sorry I missed that detail earlier, I'll see if I can do that

yuja added a commit to yuja/jj that referenced this issue Nov 20, 2024
I noticed miniz_oxide appears in perf samples. While miniz_oxide is safer, I
think zlib-ng is pretty reliable.

https://docs.rs/gix/latest/gix/#performance

libz-ng-sys is downgraded to 1.1.16 due to the Windows linking issue. The
benchmark result is obtained with libz-ng-sys 1.1.20.

rust-lang/libz-sys#225

```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
  'target/release-with-debug/{bin} --ignore-working-copy log README.md'
Benchmark 1: target/release-with-debug/jj-0 ..
  Time (mean ± σ):     256.6 ms ±   4.3 ms    [User: 214.1 ms, System: 38.6 ms]
  Range (min … max):   245.4 ms … 261.2 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 ..
  Time (mean ± σ):     223.0 ms ±   4.2 ms    [User: 174.7 ms, System: 44.4 ms]
  Range (min … max):   212.4 ms … 225.8 ms    10 runs
```
yuja added a commit to yuja/jj that referenced this issue Nov 20, 2024
I noticed miniz_oxide appears in perf samples. While miniz_oxide is safer, I
think zlib-ng is pretty reliable.

https://docs.rs/gix/latest/gix/#performance

libz-ng-sys is downgraded to 1.1.16 due to the Windows linking issue. The
benchmark result is obtained with libz-ng-sys 1.1.20.

rust-lang/libz-sys#225

```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
  'target/release-with-debug/{bin} --ignore-working-copy log README.md'
Benchmark 1: target/release-with-debug/jj-0 ..
  Time (mean ± σ):     256.6 ms ±   4.3 ms    [User: 214.1 ms, System: 38.6 ms]
  Range (min … max):   245.4 ms … 261.2 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 ..
  Time (mean ± σ):     223.0 ms ±   4.2 ms    [User: 174.7 ms, System: 44.4 ms]
  Range (min … max):   212.4 ms … 225.8 ms    10 runs
```
yuja added a commit to yuja/jj that referenced this issue Dec 5, 2024
I noticed miniz_oxide appears in perf samples. While miniz_oxide is safer, I
think zlib-ng is pretty reliable.

https://docs.rs/gix/latest/gix/#performance

libz-ng-sys is downgraded to 1.1.16 due to the Windows linking issue. The
benchmark result is obtained with libz-ng-sys 1.1.20.

rust-lang/libz-sys#225

```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
  'target/release-with-debug/{bin} --ignore-working-copy log README.md'
Benchmark 1: target/release-with-debug/jj-0 ..
  Time (mean ± σ):     256.6 ms ±   4.3 ms    [User: 214.1 ms, System: 38.6 ms]
  Range (min … max):   245.4 ms … 261.2 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 ..
  Time (mean ± σ):     223.0 ms ±   4.2 ms    [User: 174.7 ms, System: 44.4 ms]
  Range (min … max):   212.4 ms … 225.8 ms    10 runs
```
yuja added a commit to yuja/jj that referenced this issue Dec 6, 2024
I noticed miniz_oxide appears in perf samples. While miniz_oxide is safer, I
think zlib-ng is pretty reliable.

https://docs.rs/gix/latest/gix/#performance

libz-ng-sys is downgraded to 1.1.16 due to the Windows linking issue. The
benchmark result is obtained with libz-ng-sys 1.1.20.

rust-lang/libz-sys#225

```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
  'target/release-with-debug/{bin} --ignore-working-copy log README.md'
Benchmark 1: target/release-with-debug/jj-0 ..
  Time (mean ± σ):     256.6 ms ±   4.3 ms    [User: 214.1 ms, System: 38.6 ms]
  Range (min … max):   245.4 ms … 261.2 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 ..
  Time (mean ± σ):     223.0 ms ±   4.2 ms    [User: 174.7 ms, System: 44.4 ms]
  Range (min … max):   212.4 ms … 225.8 ms    10 runs
```
yuja added a commit to jj-vcs/jj that referenced this issue Dec 6, 2024
I noticed miniz_oxide appears in perf samples. While miniz_oxide is safer, I
think zlib-ng is pretty reliable.

https://docs.rs/gix/latest/gix/#performance

libz-ng-sys is downgraded to 1.1.16 due to the Windows linking issue. The
benchmark result is obtained with libz-ng-sys 1.1.20.

rust-lang/libz-sys#225

```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
  'target/release-with-debug/{bin} --ignore-working-copy log README.md'
Benchmark 1: target/release-with-debug/jj-0 ..
  Time (mean ± σ):     256.6 ms ±   4.3 ms    [User: 214.1 ms, System: 38.6 ms]
  Range (min … max):   245.4 ms … 261.2 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 ..
  Time (mean ± σ):     223.0 ms ±   4.2 ms    [User: 174.7 ms, System: 44.4 ms]
  Range (min … max):   212.4 ms … 225.8 ms    10 runs
```
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

No branches or pull requests

4 participants