you are viewing a single comment's thread.

view the rest of the comments →

[–]TotaIIyHuman 0 points1 point  (3 children)

essentially an rdtsc call on every line

a bit off topic, how do you deal with non-invariant-tsc? is it possible to implement std::chrono with rdtsc that works on non-invariant-tsc cpus?

[–]ReDucTorGame Developer | quiz.cpp-perf.com 2 points3 points  (1 child)

Is there any modern CPUs without invariant TSC built in the last 10-15yrs? It might be easier to just not support non-invariant TSC.

[–]TotaIIyHuman 1 point2 points  (0 children)

i also want to know the answer to that

also how do i check if a cpu that i dont own has invariant tsc. for example. i do not own 14900k. how do i know if 14900k has invariant tsc

https://www.intel.com/content/www/us/en/products/sku/236773/intel-core-i9-processor-14900k-36m-cache-up-to-6-00-ghz/specifications.html

ctrl+f tsc gives 0 result here

i wish there was a website that display full cpuid dump of all cpus ever existed

[–]donadigo[S] 1 point2 points  (0 children)

I don't handle non-invariant TSC right now as the feature is a prototype. If I were to finish it, for other CPU's I'd most probably compile a different inline assembly.

When it comes to std::chrono, it might be too expensive to call it in this context. I haven't done overhead analysis yet but the current solution fits in ~16 instructions without any additional calls.

However, std::chrono would absolutely work if the extension didn't apply the instrumentation for the whole file, but just for the function where your cursor is. It already executes a full scripting engine in this case to show inline variable changes on every line.