Skip to content

Commit 158e9a8

Browse files
committed
chore: add timings to compilation
1 parent 58168f3 commit 158e9a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

c2me-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/mixin/MixinNoiseConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ishland.c2me.opts.dfc.mixin;
22

3+
import com.google.common.base.Stopwatch;
34
import com.ishland.c2me.opts.dfc.common.gen.BytecodeGen;
45
import it.unimi.dsi.fastutil.objects.Reference2ReferenceMap;
56
import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
@@ -26,6 +27,7 @@ public class MixinNoiseConfig {
2627

2728
@Inject(method = "<init>", at = @At("RETURN"))
2829
private void postCreate(CallbackInfo ci) {
30+
Stopwatch stopwatch = Stopwatch.createStarted();
2931
Reference2ReferenceMap<DensityFunction, DensityFunction> tempCache = new Reference2ReferenceOpenHashMap<>();
3032
this.noiseRouter = new NoiseRouter(
3133
BytecodeGen.compile(this.noiseRouter.barrierNoise(), tempCache),
@@ -53,6 +55,8 @@ private void postCreate(CallbackInfo ci) {
5355
BytecodeGen.compile(this.multiNoiseSampler.weirdness(), tempCache),
5456
this.multiNoiseSampler.spawnTarget()
5557
);
58+
stopwatch.stop();
59+
System.out.println(String.format("Density function compilation finished in %s", stopwatch));
5660
}
5761

5862
}

0 commit comments

Comments
 (0)