File: simple_stack_benchmark.groovy

package info (click to toggle)
multiverse-core 0.7.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 5,784 kB
  • sloc: java: 59,009; xml: 1,717; sh: 13; makefile: 5
file content (32 lines) | stat: -rw-r--r-- 1,069 bytes parent folder | download | duplicates (4)
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
import org.benchy.Benchmark
import org.benchy.GroovyTestCase
import org.multiverse.stms.beta.benchmarks.SimpleStackDriver

def benchmark = new Benchmark();
benchmark.name = "simple_stack"

for (def k in 1..processorCount) {
    def testCase = new GroovyTestCase()
    testCase.name = "simple_stack_with_${k}_threads"
    testCase.pushThreadCount = k
    testCase.popThreadCount = k
    testCase.durationInSeconds=30
    testCase.transactionsPerThread = 1000 * 1000 * 10L
    testCase.warmupRunIterationCount = k==1?1:0;
    testCase.driver = SimpleStackDriver.class
    benchmark.add(testCase)
}

for (def k in 1..processorCount) {
    def testCase = new GroovyTestCase()
    testCase.name = "simple_stack_using_pooled_closures_with_${k}_threads"
    testCase.pushThreadCount = k
    testCase.popThreadCount = k
    testCase.durationInSeconds=30
    testCase.poolClosures = true
    testCase.transactionsPerThread = 1000 * 1000 * 10L
    testCase.warmupRunIterationCount = k==1?1:0;
    testCase.driver = SimpleStackDriver.class
    benchmark.add(testCase)
}
benchmark