Giter Site home page Giter Site logo

Comments (2)

fabiolimace avatar fabiolimace commented on May 22, 2024

Benchmark results before the changes:

Benchmark              Mode  Cnt       Score      Error   Units
Throughput.compareTo  thrpt    5  220079,691 ±  517,983  ops/ms
Throughput.equals     thrpt    5  324611,500 ± 3358,493  ops/ms
Throughput.hashCode   thrpt    5  419975,993 ± 4158,182  ops/ms

Benchmark results after the changes:

Benchmark              Mode  Cnt       Score       Error   Units
Throughput.compareTo  thrpt    5  354694,538 ± 10091,845  ops/ms (1.611667)
Throughput.equals     thrpt    5  437656,101 ±  2504,245  ops/ms (1.348248)
Throughput.hashCode   thrpt    5  459955,540 ±  4697,826  ops/ms (1.095196)

Benchmark code:

package benchmark;

import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Threads;
import org.openjdk.jmh.annotations.Warmup;

import com.github.f4b6a3.tsid.Tsid;
import com.github.f4b6a3.tsid.TsidCreator;

@Fork(1)
@Threads(1)
@State(Scope.Benchmark)
@Warmup(iterations = 5, time = 1)
@Measurement(iterations = 5, time = 3)
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public class Throughput {

	Tsid tsid1 = new Tsid(0);
	Tsid tsid2 = new Tsid(0);
	
	@Benchmark
	public int compareTo() {
		return tsid1.compareTo(tsid2);
	}

	@Benchmark
	public boolean equals() {
		return tsid1.equals(tsid2);
	}

	@Benchmark
	public int hashCode() {
		return tsid1.hashCode();
	}
}

from tsid-creator.

fabiolimace avatar fabiolimace commented on May 22, 2024

Released v5.0.1

from tsid-creator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.