Login
You're viewing the code4lib.social public feed.
  • Nov 26, 2026, 12:36 AM

    Hmmm... comparing Superluminal, VisualStudio and VerySleepy, they all show the same function-level profiling, but in the per-C++-line attribution, VerySleepy is the only one that makes sense. The other two agree with each other, but there's no way they're correct.

    Anybody else seen this?

    This is pretty simple straight-line code, run in a tight loop, all standard x64 integer and SSE code. Bread-and-butter profiling stuff.

    💬 2🔄 0⭐ 0

Replies

  • Nov 26, 2026, 2:21 AM

    Wild. If I take the exact same function that only uses scalar SSE (except for moves) and add a pointless "addps" at the start of the function, the ETW profilers suddenly see around 50% of the time is spent around that instruction. Not actually ON, it but NEAR it. VerySleepy doesn't see this.

    There is also a "rainshadow" effect of maybe 30-40 instructions after that spike that are basically free - almost no samples attributed there!

    After that, the effect goes and the profilers all agree.

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 2:23 AM

    So something in the ETW system sees a vector SSE instruction (how?) and completely screws up the attribution of costs anywhere near it - they all get "dragged" towards that instruction and away from nearby and following instructions. Absolutely wild.

    Dumb old sampling profiler sees no effect at all.

    💬 2🔄 0⭐ 0
  • Nov 26, 2026, 2:29 AM

    This is a Zen 4 Threadripper 7x00 series BTW. I don't see anything in Agner about 1-lane vs 4-lane SSE being treated differently. And even if it was, why wouldn't VerySleepy see it?

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 12:43 AM

    @TomF As far as I can see, Superluminal and Visual Studio both use the underlying ETW for their sampling, so would have similar results, while VerySleepy doesn't use ETW. I could be wrong though.

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 12:47 AM

    @kojack That's the only commonality I could see too. But I don't know why that would change per-line attribution without also distorting the per-function cost.

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 12:51 AM

    @kojack One slight clue - they kind-of agree for the first half of the function, but not the second half. The ETW ones scream and yell at a specific line, and everything after that is basically "free", whereas VerySleepy has a more balanced view.

    And that line is the only one that uses SSE that is more than scalar, i.e. it's "ps" rather than "ss". Is that freaking out the ETW for some reason? It's just SSE not AVX or anything fancy.

    💬 0🔄 0⭐ 0
  • Nov 26, 2026, 2:25 AM

    @TomF that... Feels cursed.
    Like, I occasionally look at ETW traces for work, and I'm not sure I wanted to know this 😅

    💬 0🔄 0⭐ 0
  • Nov 26, 2026, 3:40 AM

    @TomF is the program slower under ETW than other profilers, when the addps is present? Could be that ETW messes up the vector state for the profilee.

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 5:27 AM

    @pkhuong It doesn't seem to be. All three profiled roughly the same total time. But it is "roughly" - could be maybe a 10% difference - I didn't check that closely.

    💬 0🔄 0⭐ 0