6 test
:= method(TestSuite
clone setPath(launchPath
) run
)
8 time
:= Date clone cpuSecondsToRun(r
:= test
)
9 writeln("time: ", time
, " seconds")
16 maxAllocatedBytes (millions)
20 writeln("mpa as mb time mbt gc")
24 //aaa
:= method(1.1 + 2.2)
25 //test
:= method(10000 repeat(aaa
))
27 list(1.01, 1.05, 1.1, 1.2, 1.5, 1.7, 2, 4) foreach(as
,
28 list( 0.01, .1, 1, 2, 4, 16) foreach(mpa
,
30 Collector
setMarksPerAlloc(mpa
)
31 Collector
setAllocatedStep(as
)
33 time
:= Date clone cpuSecondsToRun(test
)
34 mb
:= (Collector maxAllocatedBytes
/1000000) asString(0,2)
36 writeln(Collector marksPerAlloc
asString(0,2), "\t",
37 Collector allocatedStep
asString(0,2), "\t",
39 time
asString(0,2) , "\t",
40 (mb asNumber
* time
) asString(0,2), "\t",
41 (100*(Collector timeUsed
- lastTimeUsed
)/time
) asString(2, 1), "%")
43 lastTimeUsed
= Collector timeUsed
46 Collector resetMaxAllocatedBytes
53 writeln("mpa mps spg mb time mbt")
55 list(16, 64, 128) foreach(spg,
56 list(1, 10, 100) foreach(mpa,
57 list(100, 10000) foreach(mps,
59 Collector setMarksPerAlloc(mpa)
60 Collector setMarksPerSweep(mps)
61 Collector setSweepsPerGeneration(spg)
63 time := Date clone cpuSecondsToRun(r := TestSuite clone setPath(launchPath) run)
64 mb := (Collector maxAllocatedBytes/1000000) asString(0,1)
66 writeln(Collector marksPerAlloc asString(0,1), "\t", Collector marksPerSweep, "\t", Collector sweepsPerGeneration, "\t", mb, "\t", time asString(0,1) , "\t", (mb asNumber * time) asString(0,1) )
68 30 repeat(Collector collect)
69 Collector resetMaxAllocatedBytes