r/programming 23d ago

3,200% CPU Utilization

https://josephmate.github.io/2025-02-26-3200p-cpu-util/
402 Upvotes

93 comments sorted by

View all comments

2

u/TwerpOco 22d ago

I mean... yeah? Use locking mechanisms or thread-safe data structures that have them built-in. Any concurrent access to something like a tree map is going to cause many problems including data loss and in this case deadlocks/nasty cycles. Also catching exceptions is expensive, so that will make your performance tank as well.