3 ms·
Not really... the wasted time is still all malloc() / realloc() / whatever under array.push(), and a half-decent callgraph profiler will catch that. array.push(
by tbrownaw 11y ago
Not really... the wasted time is still all malloc() / realloc() / whatever under array.push(), and a half-decent callgraph profiler will catch that. array.push() will score far higher than it ought to, and the bulk of its time will be the reallocation.
Source: I've used oprofile, and later perf, to hunt exactly this kind of performance bug.
.
Of course, fixing a pervasive issue like that is much more tedious than just finding it. :-(