4 ms·
This becomes impossible to do correctly because of the halting problem, interestingly. For example, suppose a routine calls F in a loop for most of its work, th
by toxik 4y ago
This becomes impossible to do correctly because of the halting problem, interestingly. For example, suppose a routine calls F in a loop for most of its work, then at the end takes the square root by sqrtf(). Clearly number of calls matters for the edge weight in the call graph, but this tool would count F and sqrtf equal.
I suppose you could do it by sampling, then you actually just have to look at the sample distribution, though that would show you the graph weighted by cumulative execution times per routine.
As they say though, never let perfect be the enemy of good. Neat idea.
- lpapez 4y agoI think you are mixing performance analysis with dependency analysis which is the point of the project. The sampling you are describing is commonly done by tools called "sampling profilers".
- enneff 4y agoThis actually has nothing to do with how often the code is executed. Code is ranked by its referents.
- toxik 4y agoRight, which is exactly what I pointed out. The true call graph can only be obtained by basically running the program. Counting references is clearly a compromise here. To see its drawbacks, consider indirection and dynamism.
- naniwaduni 4y agoThis reaction is kind of like reading about a pre-election poll where the participants were selected by pulling them off 86th street at 11 am, and objecting that the percentages shouldn't be presented with more than two sig figs with a sample size of 100. You're not, strictly speaking, wrong. But the methodology is already known to be deeply compromised, so your objection is kind of out there.
- toxik 4y agoIt was an observation that the choice to use references is actually a must, because of the halting problem, which I found interesting. Not everything is an argumentation.
- enneff 4y agoBut this is about ranking code based on how central it is, for the purposes of choosing what to translate to TypeScript first. It’s not a compromise, it’s the correct approach. How often a line of code is executed is not relevant for this purpose.