Skip to content

Commit 3938e2d

Browse files
committed
close stage + update benchmark
1 parent 1283604 commit 3938e2d

2 files changed

Lines changed: 36 additions & 27 deletions

File tree

benchmark/results/benchmark-results.txt

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,64 +10,68 @@ GCC : gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
1010
============================================================
1111

1212
BENCHMARK RESULTS — flecs-java vs flecs C vs Artemis-odb
13-
Date : 2026-02-26 19:40:58
13+
Date : 2026-02-27 14:36:30
1414

1515
[ Java / JMH ]
1616
------------------------------------------------------------
1717
Benchmark Mode Cnt Score Error Units
1818
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create avgt 3 0,012 ± 0,001 us/op
19-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create:·gc.alloc.rate avgt 3 5779,267 ± 237,730 MB/sec
19+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create:·gc.alloc.rate avgt 3 5770,913 ± 186,332 MB/sec
2020
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create:·gc.alloc.rate.norm avgt 3 75,435 ± 0,001 B/op
21-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create:·gc.count avgt 3 53,000 counts
22-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create:·gc.time avgt 3 40,000 ms
21+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create:·gc.count avgt 3 46,000 counts
22+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.create:·gc.time avgt 3 25,000 ms
2323
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components avgt 3 0,070 ± 0,001 us/op
24-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components:·gc.alloc.rate avgt 3 2168,235 ± 28,534 MB/sec
24+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components:·gc.alloc.rate avgt 3 2168,045 ± 30,569 MB/sec
2525
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components:·gc.alloc.rate.norm avgt 3 160,409 ± 0,001 B/op
26-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components:·gc.count avgt 3 28,000 counts
27-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components:·gc.time avgt 3 17,000 ms
28-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab avgt 3 0,037 ± 0,003 us/op
29-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.alloc.rate avgt 3 2959,915 ± 235,096 MB/sec
26+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components:·gc.count avgt 3 21,000 counts
27+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2Components:·gc.time avgt 3 35,000 ms
28+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab avgt 3 0,037 ± 0,002 us/op
29+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.alloc.rate avgt 3 2970,476 ± 141,136 MB/sec
3030
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.alloc.rate.norm avgt 3 115,435 ± 0,001 B/op
31-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.count avgt 3 34,000 counts
32-
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.time avgt 3 45,000 ms
31+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.count avgt 3 28,000 counts
32+
c.g.e.f.b.artemisodb.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.time avgt 3 41,000 ms
3333
c.g.e.f.b.artemisodb.QueryBenchmark.query avgt 3 0,002 ± 0,001 us/op
3434
c.g.e.f.b.artemisodb.QueryBenchmark.query:·gc.alloc.rate avgt 3 ≈ 10⁻³ MB/sec
3535
c.g.e.f.b.artemisodb.QueryBenchmark.query:·gc.alloc.rate.norm avgt 3 ≈ 10⁻⁶ B/op
3636
c.g.e.f.b.artemisodb.QueryBenchmark.query:·gc.count avgt 3 ≈ 0 counts
37-
c.g.e.f.b.flecs.EntityCreationBenchmark.create avgt 3 0,014 ± 0,002 us/op
38-
c.g.e.f.b.flecs.EntityCreationBenchmark.create:·gc.alloc.rate avgt 3 0,499 ± 0,052 MB/sec
37+
c.g.e.f.b.flecs.EntityCreationBenchmark.create avgt 3 0,014 ± 0,001 us/op
38+
c.g.e.f.b.flecs.EntityCreationBenchmark.create:·gc.alloc.rate avgt 3 0,496 ± 0,060 MB/sec
3939
c.g.e.f.b.flecs.EntityCreationBenchmark.create:·gc.alloc.rate.norm avgt 3 0,027 ± 0,001 B/op
4040
c.g.e.f.b.flecs.EntityCreationBenchmark.create:·gc.count avgt 3 ≈ 0 counts
41-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components avgt 3 0,160 ± 0,014 us/op
42-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components:·gc.alloc.rate avgt 3 301,241 ± 7,516 MB/sec
41+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components avgt 3 0,158 ± 0,012 us/op
42+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components:·gc.alloc.rate avgt 3 302,041 ± 25,250 MB/sec
4343
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components:·gc.alloc.rate.norm avgt 3 64,032 ± 0,001 B/op
44-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components:·gc.count avgt 3 6,000 counts
45-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components:·gc.time avgt 3 2,000 ms
46-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsFromPrefab avgt 3 0,193 ± 0,002 us/op
47-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.alloc.rate avgt 3 0,132 ± 0,002 MB/sec
44+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components:·gc.count avgt 3 7,000 counts
45+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2Components:·gc.time avgt 3 3,000 ms
46+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsFromPrefab avgt 3 0,195 ± 0,008 us/op
47+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.alloc.rate avgt 3 0,132 ± 0,005 MB/sec
4848
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.alloc.rate.norm avgt 3 0,033 ± 0,001 B/op
4949
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsFromPrefab:·gc.count avgt 3 ≈ 0 counts
50-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsNoAlloc avgt 3 0,150 ± 0,012 us/op
51-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsNoAlloc:·gc.alloc.rate avgt 3 0,225 ± 0,014 MB/sec
52-
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsNoAlloc:·gc.alloc.rate.norm avgt 3 0,045 ± 0,001 B/op
50+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsNoAlloc avgt 3 0,150 ± 0,018 us/op
51+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsNoAlloc:·gc.alloc.rate avgt 3 0,213 ± 0,023 MB/sec
52+
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsNoAlloc:·gc.alloc.rate.norm avgt 3 0,043 ± 0,001 B/op
5353
c.g.e.f.b.flecs.EntityCreationBenchmark.createWith2ComponentsNoAlloc:·gc.count avgt 3 ≈ 0 counts
54+
c.g.e.f.b.flecs.QueryBenchmark.query avgt 3 0,002 ± 0,001 us/op
55+
c.g.e.f.b.flecs.QueryBenchmark.query:·gc.alloc.rate avgt 3 1,519 ± 4,749 MB/sec
56+
c.g.e.f.b.flecs.QueryBenchmark.query:·gc.alloc.rate.norm avgt 3 0,002 ± 0,008 B/op
57+
c.g.e.f.b.flecs.QueryBenchmark.query:·gc.count avgt 3 ≈ 0 counts
5458

5559
[ C / Native ]
5660
------------------------------------------------------------
57-
Runs : 0 | Warmup: -1151013704 | Iterations: 0
61+
Runs : 0 | Warmup: 1987804344 | Iterations: 0
5862
Benchmark: create
5963
Mode: AverageTime, Time: us
60-
Score: 0.033472 ± 0.025667 us/op (batch avg: 3347.226 us, stddev: 5514.851 us)
64+
Score: 0.033457 ± 0.025265 us/op (batch avg: 3345.658 us, stddev: 5428.366 us)
6165
---------------------------------------------------
6266
Benchmark: createWith2Components
6367
Mode: AverageTime, Time: us
64-
Score: 0.128999 ± 0.040824 us/op (batch avg: 12899.913 us, stddev: 8771.499 us)
68+
Score: 0.129226 ± 0.040631 us/op (batch avg: 12922.574 us, stddev: 8729.949 us)
6569
---------------------------------------------------
6670
Benchmark: createWith2ComponentsFromPrefab
6771
Mode: AverageTime, Time: us
68-
Score: 0.112505 ± 0.013013 us/op (batch avg: 11250.480 us, stddev: 2795.909 us)
72+
Score: 0.114965 ± 0.012829 us/op (batch avg: 11496.513 us, stddev: 2756.404 us)
6973
---------------------------------------------------
7074
Benchmark: query
7175
Mode: AverageTime, Time: us
72-
Score: 0.000835 ± 0.000011 us/op (batch avg: 83.461 us, stddev: 2.308 us)
76+
Score: 0.000833 ± 0.000005 us/op (batch avg: 83.266 us, stddev: 1.124 us)
7377
---------------------------------------------------

src/main/java/com/github/elebras1/flecs/World.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,11 @@ public void close() {
815815
if (!this.closed) {
816816
if (this.owned && this.nativeWorld != null && this.nativeWorld.address() != 0) {
817817
flecs_h.ecs_fini(this.nativeWorld);
818+
for(World stage : this.stages) {
819+
if (stage != null && stage != this) {
820+
stage.arena.close();
821+
}
822+
}
818823
}
819824

820825
if (this.arena != null) {

0 commit comments

Comments
 (0)