1 # Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 #
4 # This code is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License version 2 only, as
6 # published by the Free Software Foundation.
7 #
8 # This code is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 # version 2 for more details (a copy is included in the LICENSE file that
12 # accompanied this code).
13 #
14 # You should have received a copy of the GNU General Public License version
15 # 2 along with this work; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 #
18 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 # or visit www.oracle.com if you need additional information or have any
20 # questions.
21
22 # Example:
23 #
24 # cd test/hotspot/jtreg/premain
25 #
26 # bash bench_data/do_bench.sh | tee bench_data/bench.20250930.txt
27 # taskset -c 1,2 bash bench_data/do_bench.sh | tee bench_data/bench.20250930-2cpu.txt
28
29 # <<<< start: capture the output of (set -x; ...) as well
30 (
31
32 VERSION=$(git log -1 | head -1 | sed -e 's/commit //')
33
34 echo Raw data generated by $USER on $(date)
35
36 echo
37 echo HOWTO: https://github.com/openjdk/leyden/blob/$VERSION/README.md#5-benchmarking
38
39 echo
40 (set -x; bash -c 'cat /proc/cpuinfo | egrep "(vendor_id)|(model name)" | head -2')
41 (set -x; bash -c 'cat /proc/cpuinfo | egrep "(processor)" | tail -1')
42 (set -x; bash -c 'cat /proc/meminfo | head -1')
43
44 echo
45 (set -x; cat /etc/lsb-release)
46
47 echo
48 (set -x; bash -c '$BLDJDK_HOME/bin/java --version')
49
50 echo
51 (set -x; bash -c '$MAINLINE_HOME/bin/java --version')
52
53 echo
54 (set -x; bash -c '$PREMAIN_HOME/bin/java --version')
55
56 echo PREMAIN_HOME: built from https://github.com/openjdk/leyden/commit/$VERSION
57
58 BENCHES=
59 BENCHES="$BENCHES helidon-quickstart-se"
60 BENCHES="$BENCHES javac_bench"
61 BENCHES="$BENCHES micronaut-first-app"
62 BENCHES="$BENCHES quarkus-getting-started"
63 BENCHES="$BENCHES spring-boot-getting-started"
64 BENCHES="$BENCHES spring-petclinic"
65
66 echo
67
68 for b in $BENCHES; do
69 echo ------------------------------------------------------------
70 (set -x; bash -c "cd $b; make bench")
71 (set -x; bash -c "cat $b/mainline_vs_premain.md")
72 done
73
74 # >>>> end
75 ) 2>&1
76
77
78