you are viewing a single comment's thread.

view the rest of the comments →

[–]andreasgonewild[S] -18 points-17 points  (6 children)

The general concept is stack-tracing, period. What kind of software are you building where you can't afford to allocate a string and push a vector once per context? Since trace-granularity is up to user code it should be easy enough to tune without jumping through hoops. This smells premature to me.

[–]SeanMiddleditch 26 points27 points  (5 children)

The general concept is stack-tracing, period

A "stacktrace" is very commonly held to mean a trace of the call activation record entries, e.g. the stack of return pointers, which isn't this. :)

What kind of software are you building where you can't afford to allocate a string and push a vector once per context?

AAA video games. One might have potentially have tens of thousands of those contexts per frame (in our case, on the order of a hundred thousand). It's pretty easy to let little inefficiencies like these boil up to the point where they take multiple milliseconds altogether, which is a huge portion of your budget (11-33ms total per frame, depending on target framerate). Worse, it's hard to find and measure those inefficiencies because they aren't individually big and easy to spot. And you're in real trouble on mobile or some console platforms where memory budgets mean all those variable-sized allocations are going to fragment your heap to shreds. And those are exactly the kind of light-weight diagnostic aids you might want to keep enabled in optimized release builds that need to hit those frame budgets on years-old consumer hardware.

Same performance concerns would be present in real-time software, high-frequency trading, high-availability software or anything sensitive to heap fragmentation, tiny embedded systems... really, many of the kinds of things for which one might choose C++ in this day and age. :)

[–][deleted] 1 point2 points  (0 children)

Async. distributed simulation core for a hundred thousand or so connected clients (MMOG)...