Skip to content

prefetch in mark - #516

Merged
augustss merged 1 commit into
augustss:masterfrom
Rewbert:prefetch_mark
Sep 3, 2026
Merged

prefetch in mark#516
augustss merged 1 commit into
augustss:masterfrom
Rewbert:prefetch_mark

Conversation

@Rewbert

@Rewbert Rewbert commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Prefetching in mark gave me some mixed results, but generally good ones I think. A majority of my cache misses were in mark, which is not surprising as it is quite chaotic. However, it does push nodes to a stack in order to visit them later, and by prefetching a node when it is pushed, I get fewer cache misses.

When compiling the compiler as the benchmark, I get 31% fewer cache misses, and my average runtime (over 5 runs) goes from 70.5 seconds to 66 seconds. The time spent marking nodes goes from 10.8 to 7.4 seconds.

However, when I test the change against the benchmarks mentioned in pr #515 , I get some more mixed results. The below percentages are the differences in absolute execution times, averaged over five runs.

NFib - +7.5%
FibTail - +3.4%
FibInt - +3.5%
NumericIntegration - +2.5%
TightIntLoop - +2.5%
ListFusion - +1.6%
FibInteger - +1.2%
PrimeSieve - +0.8%
MergeSort - -0.8%
ForkJoin - -0.8%
ExprVal - -0.4%

They are microbenchmarks, and don't run for as long. Additionally, the behavior of mark is naturally tightly related to the live node set, the allocation rate, etc etc. This differs between all these programs.

@augustss
augustss merged commit 4557821 into augustss:master Sep 3, 2026
11 of 12 checks passed
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