All Downloads are FREE. Search and download functionalities are using the official Maven repository.

convex.benchmarks.MapBenchmark Maven / Gradle / Ivy

There is a newer version: 0.7.15
Show newest version
package  convex.benchmarks;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.options.Options;

import convex.core.data.AMap;
import convex.core.data.Maps;
import convex.core.data.prim.CVMLong;

public class MapBenchmark {

	@Benchmark
	public void assocMap1000() {
		AMap m = Maps.empty();
		for (long i = 0; i < 1000; i++) {
			CVMLong ci=CVMLong.create(i);
			m = m.assoc(ci, ci);
		}
	}

	public static void main(String[] args) throws Exception {
		Options opt = Benchmarks.createOptions(MapBenchmark.class);
		new Runner(opt).run();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy