News for hackers. Stuff that matters.
Re:The Performance Impact of C++'s `final` Keyword by klyrs on Monday April 22, 2024 @04:20PM (#40119643)
> A large part of becoming a decent engineer [2] for me was learning to stop trusting what professors taught me in college

When I was taught about performance, it was all about benchmarking and profiling. I never needed to trust what my professors taught, because they taught me to dig in and find the truth for myself. This was taught alongside the big-O stuff, with several examples where "fast" algorithms are slower on small inputs.

Re:The Performance Impact of C++'s `final` Keyword by TylerE on Monday April 22, 2024 @04:24PM (#40119718)
How do you even get meaningful profiling out of most modern langs? It seems the vast majority of time and calls gets spent inside tiny anonymous functions, GC allocations, and stuff like that.
Re:The Performance Impact of C++'s `final` Keyword by klyrs on Monday April 22, 2024 @05:15PM (#40120880)
I don't use most modern langs! And especially if I'm doing work where performance is critical, I won't kneecap myself by using a language that I can't reasonably profile.
Re:The Performance Impact of C++'s `final` Keyword by neonsunset on Monday April 22, 2024 @06:47PM (#40123459)
This is easy in most modern programming languages.

JVM ecosystem has IntelliJ Idea profiler and similar advanced tools (AFAIK).

.NET has VS/Rider/dotnet-trace profilers (they are very detailed) to produce flamegraphs.

Then there are native profilers which can work with any AOT compiled language that produces canonically symbolicated binaries: Rust, C#/F#(AOT mode), Go, Swift, C++, etc.

For example, you can do `samply record ./some_binary`[0] and then explore multi-threaded flamegraph once completed (I use it to profile C#, it's more convenient than dotTrace for preliminary perf work and is usually more than sufficient).

[0] https://github.com/mstange/samply

Re:The Performance Impact of C++'s `final` Keyword by TylerE on Tuesday April 23, 2024 @03:21PM (#40136062)
I mean sure, but I've never seen much in a flamegraph besides noise.
Re:The Performance Impact of C++'s `final` Keyword by neonsunset on Tuesday April 23, 2024 @05:29PM (#40137528)
My experience is complete opposite. You just need to construct a realistic load test for the code and the bottlenecks will stand out (more often than not).

Also there is learning curve to grouping and aggregating data.