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

MUSL version is very slow compared to shared lib one #630

Open
1 task done
inglor opened this issue Apr 30, 2024 · 8 comments
Open
1 task done

MUSL version is very slow compared to shared lib one #630

inglor opened this issue Apr 30, 2024 · 8 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed performance Performance related

Comments

@inglor
Copy link

inglor commented Apr 30, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

The musl verison of the application is slow compared to the one using glibc one.

Steps To Reproduce

Execute git-cliff musl and observe being slow

Expected behavior

Same performance as glibc

Screenshots / Logs

No response

Software information

  • Operating system: Amazon Linux 2
  • Rust version: N/a (downloaded the provided binary)
  • Project version: latest

Additional context

No response

@inglor inglor added the bug Something isn't working label Apr 30, 2024
Copy link

welcome bot commented Apr 30, 2024

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@orhun orhun added the help wanted Extra attention is needed label May 1, 2024
@orhun
Copy link
Owner

orhun commented May 1, 2024

I don't have much experience with MUSL but I ran a profiler for comparison:

There isn't a big difference here. It might be a good idea to investigate the calls though.

Can you share the repo you are running git-cliff with?

@inglor
Copy link
Author

inglor commented May 1, 2024

Unfortunately no since it's internal at work. But can run profiler myself potentially.

@orhun
Copy link
Owner

orhun commented May 1, 2024

Sounds good (it's samply), let me know.

@orhun
Copy link
Owner

orhun commented May 1, 2024

Here are some instructions:

git clone https://github.com/orhun/git-cliff && cd git-cliff/

cargo build
samply record target/debug/git-cliff --no-exec -w "$workdir"

rustup target add x86_64-unknown-linux-musl
cargo build --target x86_64-unknown-linux-musl
samply record target/x86_64-unknown-linux-musl/debug/git-cliff --no-exec -w "$workdir"

Then on the browser you can upload profile.json at top right.

@orhun
Copy link
Owner

orhun commented May 9, 2024

Had any chance to try out the profiler?

@inglor
Copy link
Author

inglor commented May 10, 2024

I did but showed nothing obvious. If the flamegraph seems the same I'm thinking it has to do with the loading of shared libs before the execution of the program itself. The environment it's running on is in AWS Linux 2 (with an old glibc version that's why I'm using musl) and has some 'enterprise' daemons running so I'm assuming it's scanning everything before it tries to execute them? Speculation from my side.

@orhun
Copy link
Owner

orhun commented May 10, 2024

Yeah, that might be the case. Can you share some execution times? I'm just curious about how slow it is.

Also there is this blog post from 2020 FWIW: https://andygrove.io/2020/05/why-musl-extremely-slow/

@orhun orhun changed the title git-cliff musl version is very slow compared to shared lib one MUSL version is very slow compared to shared lib one May 23, 2024
@orhun orhun added the performance Performance related label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed performance Performance related
Projects
None yet
Development

No branches or pull requests

2 participants