@@ -65,14 +65,19 @@ PC_APP_UNPACKED = ${PC_REPO}/target/unpacked
65
65
PC_APP_UNPACKED_ZIP = ${PC_REPO}/target/spring-petclinic-3.2.0.zip
66
66
67
67
PC_MAIN_CLASS = org.springframework.samples.petclinic.PetClinicApplication
68
- PC_CLASSLIST = spring-petclinic.classlist
69
- PC_STATIC_JSA = spring-petclinic.static.jsa
70
- PC_DYNAMIC_JSA = spring-petclinic.dynamic.jsa
71
- PC_CACHED_CODE = spring-petclinic.code.jsa
68
+
69
+ # Note: you can add specify PM_VER (PreMain Version) for comparing the performance of different builds of premain.
70
+ # See the compare_premain_builds target below
71
+
72
+ # old workflow
73
+ PC_CLASSLIST = spring-petclinic$(PM_VER ) .classlist
74
+ PC_STATIC_JSA = spring-petclinic$(PM_VER ) .static.jsa
75
+ PC_DYNAMIC_JSA = spring-petclinic$(PM_VER ) .dynamic.jsa
76
+ PC_CACHED_CODE = spring-petclinic$(PM_VER ) .code.jsa
72
77
73
78
# new workflow
74
- PC_CDS_PREIMAGE = spring-petclinic.cds.preimage
75
- PC_CDS = spring-petclinic.cds
79
+ PC_CDS_PREIMAGE = spring-petclinic$( PM_VER ) .cds.preimage
80
+ PC_CDS = spring-petclinic$( PM_VER ) .cds
76
81
77
82
# TODO: should we add -Dspring.context.exit=onRefresh to command line??
78
83
# This will make the JVM quit after printing this line:
@@ -153,7 +158,7 @@ ${PC_APP_UNPACKED}: ${PC_APP_JAR}
153
158
154
159
${PC_CLASSLIST} : ${PC_APP_UNPACKED}
155
160
${PREMAIN_JAVA} -Xshare:off -XX:DumpLoadedClassList=${PC_CLASSLIST} \
156
- -Xlog:class+load=debug:file=spring-petclinic .classload.log ${SAVE_GEN_FILES} \
161
+ -Xlog:class+load=debug:file=${PC_CLASSLIST} .classload.log ${SAVE_GEN_FILES} \
157
162
${UNPACKED_CMDLINE}
158
163
wc -lc ${PC_CLASSLIST}
159
164
@@ -270,6 +275,8 @@ clean0:
270
275
cleann :
271
276
rm -fv spring-petclinic.cds.*
272
277
278
+ # You can choose a different number of loops like this:
279
+ # make compare_premain_builds LOOPS="0 1 2" PM_OLD=.....
273
280
LOOPS = 0 1 2 3 4 5 6 7 8 9 10
274
281
275
282
mainline_vs_premain :
@@ -286,3 +293,51 @@ mainline_vs_premain:
286
293
fi ; \
287
294
first=0; \
288
295
done
296
+
297
+ # Do something like this:
298
+ # make compare_premain_builds \
299
+ # PM_OLD=/repo/old/build/linux-x64/images/jdk \
300
+ # PM_NEW=/repo/old/build/linux-x64/images/jdk
301
+ # JDK17_HOME=/my/jdk/17/home
302
+
303
+ compare_premain_builds :
304
+ @echo old build = ${PM_OLD}
305
+ @echo New build = ${PM_NEW}
306
+ @echo " Run,Old static CDS only,New static CDS only,Old static CDS + training + AOT,New static CDS + training + AOT,Old 1-step training,New 1-step training"
307
+ @first=1; for i in ${LOOPS} ; do \
308
+ rm -f tmp.txt; \
309
+ $(MAKE ) LOG_INIT= PREMAIN_HOME=${PM_OLD} PM_VER=.old runs | grep Booted >> tmp.txt; \
310
+ $(MAKE ) LOG_INIT= PREMAIN_HOME=${PM_NEW} PM_VER=.new runs | grep Booted >> tmp.txt; \
311
+ $(MAKE ) LOG_INIT= PREMAIN_HOME=${PM_OLD} PM_VER=.old run | grep Booted >> tmp.txt; \
312
+ $(MAKE ) LOG_INIT= PREMAIN_HOME=${PM_NEW} PM_VER=.new run | grep Booted >> tmp.txt; \
313
+ $(MAKE ) LOG_INIT= PREMAIN_HOME=${PM_OLD} PM_VER=.old runn | grep Booted >> tmp.txt; \
314
+ $(MAKE ) LOG_INIT= PREMAIN_HOME=${PM_NEW} PM_VER=.new runn | grep Booted >> tmp.txt; \
315
+ if test " $$ first" ! = " 1" ; then \
316
+ echo $$ i$$(cat tmp.txt | sed -e 's/.*in /,/g' -e 's/ms//g' ) | sed -e ' s/ //g' ; \
317
+ fi ; \
318
+ first=0; \
319
+ done
320
+
321
+ diff_training_logs :
322
+ @for i in old new; do \
323
+ grep cds,class spring-petclinic.$$ i.static.jsa.log | \
324
+ sed -e ' s/.*0x[0-9a-f]* ..... //g' \
325
+ -e ' s/Lambda\/0x[0-9a-f]*/Lambda\/nnn/g' \
326
+ -e ' s/MH\/0x[0-9a-f]*/MH\/nnn/g' | \
327
+ sort > old-workflow-static-classes.$$ i.txt; \
328
+ grep cds,class spring-petclinic.$$ i.dynamic.jsa.log | \
329
+ sed -e ' s/.*0x[0-9a-f]* ..... //g' \
330
+ -e ' s/Lambda\/0x[0-9a-f]*/Lambda\/nnn/g' \
331
+ -e ' s/MH\/0x[0-9a-f]*/MH\/nnn/g' | \
332
+ sort > old-workflow-dynamic-classes.$$ i.txt; \
333
+ grep cds,class spring-petclinic.$$ i.cds.log | \
334
+ sed -e ' s/.*0x[0-9a-f]* ..... //g' \
335
+ -e ' s/Lambda\/0x[0-9a-f]*/Lambda\/nnn/g' \
336
+ -e ' s/MH\/0x[0-9a-f]*/MH\/nnn/g' | \
337
+ sort > new-workflow-classes.$$ i.txt; \
338
+ done
339
+ @ls -l * .old.txt * .new.txt
340
+ @echo ' ***'
341
+ @echo " You can diff the above files to diagnose speed differences between two builds"
342
+
343
+
0 commit comments