Luke Gorrie wrote: > In that case, I suppose there's no real chance for line-based profiling, > since Instruction Pointer won't correlate well with the specific event of > interest. I wouldn't discount this so quickly. Sampling-based profilers are not based on direct correlation, yet they still come up with useful results. Instead of count++ to measure CPU time one does count += nevents. > btw is cachegrind usable with LuaJIT, either in practice or in principle? Only in principle. Apart from being rather slow it's kind of hard to interpret its results for JIT-compiled code. And its cost model for e.g. branch prediction is probably insufficient to model the actual costs on a modern x86 CPU. --Mike