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

BitSet() is perhaps slow #51287

Open
algorithmx opened this issue Sep 13, 2023 · 3 comments
Open

BitSet() is perhaps slow #51287

algorithmx opened this issue Sep 13, 2023 · 3 comments
Labels
performance Must go faster

Comments

@algorithmx
Copy link

BitSet() = new(resize!(Vector{UInt64}(undef, 4), 0), NO_OFFSET)

Dear Julia developers,

I work in a company and we build TCAD simulators using Julia.

I have been optimising my code and realised that creating empty BitSet() takes significant amount of time. Below are the prof and memprof results. Please help me to get over of this overhead, if it is possible. Thank you!

Screenshot from 2023-09-13 11-05-00
Screenshot from 2023-09-13 11-03-21

@oscardssmith oscardssmith added the performance Must go faster label Sep 13, 2023
@Keno
Copy link
Member

Keno commented Sep 13, 2023

You're not seeing BitSet() itself, but rather you're seeing the cost of GC. I'd recommend taking a look at your allocations with the allocation profiler and seeing if there's anything you can improve there.

@oscardssmith
Copy link
Member

that said, BitSet() is about 2x slower than it could be. It's a known issue that array creation is slower than it should be, #45160, and the resize! is also slower than it should be because it is calling out to C and has to recompute all the information about the array even though we just created it and therefore know everything about it.

@LilithHafner
Copy link
Member

See also: #50326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

No branches or pull requests

4 participants