Search in sources :

Example 1 with Benchmark

use of org.terasology.benchmark.Benchmark in project Terasology by MovingBlocks.

the class EntitySystemBenchmark method main.

public static void main(String[] args) {
    final List<Benchmark> benchmarks = Lists.newArrayList();
    benchmarks.add(new EntityCreateBenchmark());
    benchmarks.add(new IterateSingleComponentBenchmark());
    benchmarks.add(new IterateMultipleComponentBenchmark());
    Benchmarks.execute(benchmarks, new PrintToConsoleCallback());
}
Also used : PrintToConsoleCallback(org.terasology.benchmark.PrintToConsoleCallback) Benchmark(org.terasology.benchmark.Benchmark)

Example 2 with Benchmark

use of org.terasology.benchmark.Benchmark in project Terasology by MovingBlocks.

the class ReflectFactoryBenchmark method main.

public static void main(String[] args) {
    final List<Benchmark> benchmarks = Lists.newArrayList();
    benchmarks.add(new FieldAccessBenchmark(new ReflectionReflectFactory()));
    benchmarks.add(new FieldAccessBenchmark(new ByteCodeReflectFactory()));
    benchmarks.add(new GetterSetterAccessBenchmark(new ReflectionReflectFactory()));
    benchmarks.add(new GetterSetterAccessBenchmark(new ByteCodeReflectFactory()));
    benchmarks.add(new ConstructionBenchmark(new ReflectionReflectFactory()));
    benchmarks.add(new ConstructionBenchmark(new ByteCodeReflectFactory()));
    Benchmarks.execute(benchmarks, new PrintToConsoleCallback());
}
Also used : ReflectionReflectFactory(org.terasology.reflection.reflect.ReflectionReflectFactory) ByteCodeReflectFactory(org.terasology.reflection.reflect.ByteCodeReflectFactory) PrintToConsoleCallback(org.terasology.benchmark.PrintToConsoleCallback) Benchmark(org.terasology.benchmark.Benchmark)

Example 3 with Benchmark

use of org.terasology.benchmark.Benchmark in project Terasology by MovingBlocks.

the class TeraArraysBenchmark method main.

public static void main(String[] args) {
    final List<Benchmark> benchmarks = new LinkedList<>();
    benchmarks.add(new BenchmarkTeraArraySerializeObject(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToBuffer(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToByteString(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToStreamViaByteArray(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToStreamViaChannel(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayDeserializeFromBuffer(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    // 
    // 
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraDenseArray8Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraDenseArray4Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraSparseArray8Bit(16, 256, 16, INFLATED_8_BIT, DEFLATED_8_BIT)));
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraSparseArray4Bit(16, 256, 16, INFLATED_4_BIT, DEFLATED_4_BIT)));
    // 
    // 
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraDenseArray8Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraDenseArray4Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraSparseArray8Bit(16, 256, 16, INFLATED_8_BIT, DEFLATED_8_BIT)));
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraSparseArray4Bit(16, 256, 16, INFLATED_4_BIT, DEFLATED_4_BIT)));
    Benchmarks.execute(benchmarks, new PrintToConsoleCallback());
}
Also used : PrintToConsoleCallback(org.terasology.benchmark.PrintToConsoleCallback) Benchmark(org.terasology.benchmark.Benchmark) TeraDenseArray8Bit(org.terasology.world.chunks.blockdata.TeraDenseArray8Bit) LinkedList(java.util.LinkedList)

Aggregations

Benchmark (org.terasology.benchmark.Benchmark)3 PrintToConsoleCallback (org.terasology.benchmark.PrintToConsoleCallback)3 LinkedList (java.util.LinkedList)1 ByteCodeReflectFactory (org.terasology.reflection.reflect.ByteCodeReflectFactory)1 ReflectionReflectFactory (org.terasology.reflection.reflect.ReflectionReflectFactory)1 TeraDenseArray8Bit (org.terasology.world.chunks.blockdata.TeraDenseArray8Bit)1