-
Notifications
You must be signed in to change notification settings - Fork 1.6k
128 lines (126 loc) · 5.31 KB
/
benchmarks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: benchmarks
permissions: read-all
on: [ push, pull_request ]
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
PUBLISH_JDK: 21
jobs:
benchmarks:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 21, 24, GraalVM ]
env:
JAVA_VERSION: ${{ matrix.java }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.adoptium.net:443
api.github.com:443
caffeine.gradle-enterprise.cloud:443
download.java.net:443
download.oracle.com:443
downloads.gradle.org:443
downloads.gradle-dn.com:443
gds.oracle.com:443
github.com:443
jcenter.bintray.com:443
objects.githubusercontent.com:443
plugins.gradle.org:443
plugins-artifacts.gradle.org:443
repo.maven.apache.org:443
repo1.maven.org:443
raw.githubusercontent.com:443
services.gradle.org:443
www.graalvm.org:443
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Compute JMH Benchmark
uses: ./.github/actions/run-gradle
with:
java: ${{ matrix.java }}
token: ${{ secrets.GITHUB_TOKEN }}
arguments: >
caffeine:jmh --no-daemon -q
-PincludePattern=ComputeBenchmark
-PbenchmarkParameters=computeType=Caffeine,Guava,ConcurrentHashMap
- name: Upload Compute JMH Results to Gist
uses: popsiclestick/gist-sync-action@88f8633178625914f2a01abf1a765f7272a580fa # v1.2.0
if: >
github.event_name == 'push'
&& github.event.repository.fork == false
&& endsWith(github.ref, github.event.repository.default_branch)
continue-on-error: true
with:
auth: ${{ secrets.GIST_TOKEN }}
gist_description: Compute JMH Results
gist_title: compute_results_${{ matrix.java }}.json
github_file: ./caffeine/build/reports/jmh/results.json
gist_url: https://gist.githubusercontent.com/ben-manes/511298014cc5629cbc5e57f09fd4c430
- name: Get/Put JMH Benchmark
uses: ./.github/actions/run-gradle
with:
java: ${{ matrix.java }}
token: ${{ secrets.GITHUB_TOKEN }}
arguments: >
caffeine:jmh --no-daemon -q
-PincludePattern=GetPutBenchmark
-PbenchmarkParameters=cacheType=Caffeine,Guava,ConcurrentHashMap
- name: Upload Get/Put JMH Results to Gist
uses: popsiclestick/gist-sync-action@88f8633178625914f2a01abf1a765f7272a580fa # v1.2.0
if: >
github.event_name == 'push'
&& github.event.repository.fork == false
&& endsWith(github.ref, github.event.repository.default_branch)
continue-on-error: true
with:
auth: ${{ secrets.GIST_TOKEN }}
gist_description: Get/Put JMH Results
gist_title: getput_results_${{ matrix.java }}.json
github_file: ./caffeine/build/reports/jmh/results.json
gist_url: https://gist.githubusercontent.com/ben-manes/b231cf57cf8e144e2247716e777edcf3
- name: Put/Remove JMH Benchmark
uses: ./.github/actions/run-gradle
with:
java: ${{ matrix.java }}
token: ${{ secrets.GITHUB_TOKEN }}
arguments: >
caffeine:jmh --no-daemon -q
-PincludePattern=PutRemoveBenchmark
-PbenchmarkParameters=cacheType=Caffeine,Guava,ConcurrentHashMap
- name: FrequencySketch JMH Benchmark
uses: ./.github/actions/run-gradle
with:
java: ${{ matrix.java }}
token: ${{ secrets.GITHUB_TOKEN }}
arguments: >
caffeine:jmh --no-daemon -q
-PincludePattern=FrequencySketchBenchmark
-PbenchmarkParameters=tableSize=134217728
- name: TimerWheelBenchmark JMH Benchmark
uses: ./.github/actions/run-gradle
with:
java: ${{ matrix.java }}
token: ${{ secrets.GITHUB_TOKEN }}
arguments: caffeine:jmh --no-daemon -q -PincludePattern=TimerWheelBenchmark
- name: Publish JMH benchmarks
if: >
matrix.java == env.PUBLISH_JDK
&& github.event_name == 'push'
&& endsWith(github.ref, github.event.repository.default_branch)
run: |
{
echo '#### [Compute](https://jmh.morethan.io/?gists=511298014cc5629cbc5e57f09fd4c430)'
echo -n 'This benchmark that evaluates the overhead due to locking when the entry is'
echo -n 'present. The scenarios graphed are all threads retrieving a single entry'
echo -n '("sameKey") and threads retrieving different keys based on a Zipf distribution'
echo -n '("spread").'
echo -e '\n'
echo '#### [Get/Put](https://jmh.morethan.io/?gists=b231cf57cf8e144e2247716e777edcf3)'
echo -n 'A benchmark that evaluates the read/write performance of a cache. The cache is'
echo -n 'pre-populated for a 100% hit rate and a Zipf distribution of keys is used to'
echo -n 'mimic application usage patterns.'
} >> $GITHUB_STEP_SUMMARY