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

reinterpret(Type, v) performance degrades with -O1 #57228

Open
NHDaly opened this issue Jan 31, 2025 · 0 comments
Open

reinterpret(Type, v) performance degrades with -O1 #57228

NHDaly opened this issue Jan 31, 2025 · 0 comments

Comments

@NHDaly
Copy link
Member

NHDaly commented Jan 31, 2025

$ julia -O2 -e 'using BenchmarkTools; @btime reinterpret.(NTuple{48,UInt8}, $([(UInt128(1), UInt128(2), UInt128(3)) for _ in 1:1000]));'
  2.719 μs (2 allocations: 46.92 KiB)

$ julia -O1 -e 'using BenchmarkTools; @btime reinterpret.(NTuple{48,UInt8}, $([(UInt128(1), UInt128(2), UInt128(3)) for _ in 1:1000]));'
  15.292 μs (2002 allocations: 171.92 KiB)

We are discussing to extend bitcast to support non-padded (packed) isbits types, and switching to that instead.
Draft PR for that here: #57227.

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

1 participant