1 |
# (c) Tuomas J. Lukka |
# (c) Tuomas J. Lukka |
2 |
|
|
3 |
import org |
import org |
4 |
swamp = org.fenfire.swamp |
import java |
5 |
|
from org import fenfire as ff |
6 |
|
|
7 |
|
|
8 |
tim = java.lang.System.currentTimeMillis |
tim = java.lang.System.currentTimeMillis |
9 |
|
|
10 |
def bench(nrounds, nnodes = 100): |
def bench(nrounds, nnodes = 100): |
11 |
ro = swamp.bench.RDFOps(nnodes + 50) |
ro = ff.swamp.bench.RDFOps(nnodes + 50) |
12 |
ro.graph = HashGraph() |
ro.graph = ff.swamp.impl.HashGraph() |
13 |
|
|
14 |
ro.nrounds = nrounds * nnodes |
ro.nrounds = nrounds * nnodes |
15 |
ro.circleSize = nnodes |
ro.circleSize = nnodes |
16 |
|
|
17 |
ro.traverseCircle_prepare() |
ro.traverseCircle_prepare() |
18 |
|
|
19 |
t0 = tim |
t0 = tim() |
20 |
ro.traverseCircle_find1() |
ro.traverseCircle_find1() |
21 |
t1 = tim |
t1 = tim() |
22 |
|
|
23 |
|
return ((t1-t0) / 1000.0, "X") |
24 |
|
|
25 |
|
args = { |
26 |
|
"nnodes": (10,100,1000), |
27 |
|
} |