Apple Silicon P-core frequency drop, P/E-core switching add noise to CI benchmarks

Open
#534 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c, macos
Domain
performance

Research direction

Read issue #504 and locate the CI benchmark rounds, their metadata recording, and the A/A calibration runs; no files or tests are named in this issue. Determine how to measure single-threaded calibration before and after each round and how to flag or rerun affected samples, then assess separate thresholds for Tier 3. Done means benchmark metadata captures the calibration and the proposed handling is evaluated against CI noise.

Written by the indexing model from the issue text.

Description

enhancement

Follow-up to #504
I measured on the CI host (Apple M4, 4 P-cores + 6 E-cores):

macOS schedules CPU-bound threads on P-cores first. Each elfuse guest thread is its own vCPU and host thread, and elfuse follows the same placement as native threads.
When 3 or more P-cores are busy at once, every P-core slows down by about 12%. A fixed amount of work took 1812 µs with 1–2 busy threads and 2030 µs with 3–4.

Tier 1 and Tier 2 are sequential and effectively single-threaded, so they normally run at full P-core speed. Any other load on the host could push the number of busy P-cores past 2 and drop the frequency for part of a run. That would make samples shift between two levels. A cheap guard would be a short single-threaded calibration loop before and after each round, recorded in meta. If it shows the lower-frequency level, flag the round or rerun it.

Tier 3 includes multi-threaded workloads. jvm runs 8 compute threads, which is more than the 4 P-cores, so its threads move back and forth between P-cores and E-cores during the run. E-cores ran about 30% slower on a branchy workload. These metrics will likely be noisier than Tier 1 and Tier 2, so their threshold should probably be calibrated separately in the A/A runs.

Dominant language
C
Stars
287
Forks
33
Avg merge
2d 17h
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sysprog21/elfuse

All issues in sysprog21/elfuse

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.