Skip to content

Hide raw perf counters behind --show-hidden, report cache miss rate - #20

Merged
clonker merged 1 commit into
mainfrom
gather-cache-remove-cycles
Sep 24, 2026
Merged

clonker merged 1 commit into
mainfrom
gather-cache-remove-cycles

Conversation

@msooseth

@msooseth msooseth commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

compare no longer reports instructions, cycles, cache_references or cache_misses by default. They are still recorded in the JSON, and you can see them via --show-hidden. We now report cache_miss_rate (misses / references), since memory stalls dominate runtime usually. Also, it's a good metric to show in general, for example if we want to change to "flat set/map" datastructs as we have been doing

Declarations of self

  • used AI
  • read the diff forwards AND backwards. About 6 times.

@msooseth
msooseth requested a review from clonker August 31, 2026 12:38

@clonker clonker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some small remarks :) generally looking good though!

Comment thread src/solc_bench/benchmark.py Outdated
Comment thread src/solc_bench/metrics.py Outdated
Comment thread src/solc_bench/benchmark.py
Comment thread src/solc_bench/metrics.py Outdated

# Recorded in the result JSON but kept out of tables, plots and listings unless
# --show-hidden is passed.
HIDDEN = {"cycles", "instructions", "cache_references"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if cache_references is hidden, shouldn't we also hide cache_misses? also personally, i wouldn't hide instructions as an indicator of "did this code do more work or nah". i'd rather hide cpu_time i think.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cache_misses is the more important of the two. Wait, I think cpu_time is more useful than instructions? Instructions can be a poor indicator of time taken, because e.g. of cache misses, multiscalar architectures, etc. Or am I misunderstanding something?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all i have ever used cache_misses for is to compute a miss rate cache_misses / cache_references, that's where my comment comes from. not sure what you'd derive from cache misses alone?
instructions is not really a good measure for time spent but it works alright for the amount of work I think.
cpu_time / wall_time would then inform on the actual time spent.

such is my understanding but i might be wrong!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you may be confusing cpu_time -- it includes the CPU waiting. So cpu_time / wall_time is only going to tell you about IO time that the CPU is waiting (and other kernel things, but mostly IO). So I find that quite useless? Or are you interested in IO?

I find cpu_instructions very misleading. I can make it 4x and make the time 1/2 and I can make it 1/2 and make the time 4x. I think it will mislead people when they say it went up by, say, 40% when the time goes down by 20%. I want that PR to be merged, because 20% less time is amazing. Maybe you&I understand cpu_instructions, but I fear many don't. I'd be very cautious about including it in any comparison. I am already terrified of having a 40-message-long discussion about it with someone who doesn't quite understand it... And I don't have a week to waste on that discussion 😢

cache_misses / cache_references -- we can do that, OK, will show that. However, it can also lead to misunderstandings. Are you sure you want that?

If you really want all of these, you can have it, but I will be less and less interested in any discussion regarding these numbers, because, I have no energy to discuss at length about cpu_instructions going up. I'd rather not merge a 20% speedup if that means I need to argue for a week.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not suggesting we include cpu_time / wall_time as a quantity. It was meant as cpu_time slash wall_time, not division, i think we misunderstood each other here :).

as for cpu_instructions, i kind of doubt that wed have it to extremes as you outlined with solidity. afaik rustc-perf and the llvm compile time tracker thing use it as primary metric even because it has a lower signal to noise ratio. it could stay hidden as non-default output.

in any case, i am okay with not having stuff in the output and we add it if we find we need it down the line!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's now

HIDDEN = {"cycles", "instructions", "cache_references", "cache_misses"}

Comment thread README.md Outdated
Comment thread src/solc_bench/cli.py
@msooseth
msooseth force-pushed the gather-cache-remove-cycles branch from f3d699c to 7048c61 Compare September 24, 2026 09:46
@msooseth msooseth changed the title Gather cache data, don't show cpu cycles&instructions by default Hide raw perf counters behind --show-hidden, report cache miss rate Sep 24, 2026
@msooseth
msooseth force-pushed the gather-cache-remove-cycles branch 2 times, most recently from 79c338d to 00471be Compare September 24, 2026 13:21
@msooseth
msooseth force-pushed the gather-cache-remove-cycles branch from 00471be to 677b005 Compare September 24, 2026 13:26
@clonker
clonker merged commit 881ec2e into main Sep 24, 2026
1 check passed
@clonker
clonker deleted the gather-cache-remove-cycles branch September 24, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants