Skip to content

Instantly share code, notes, and snippets.

View callado4's full-sized avatar

Jose Martinez callado4

View GitHub Profile
@whym
whym / bits.scala
Last active April 24, 2017 15:42
benchmark Java/Scala BigInt/BitSet implementations
// benchmark Java/Scala BigInt/BitSet implementations
import scala.util.Random
import scala.collection.mutable
import scala.collection.immutable
import java.util.BitSet
import java.math.BigInteger
// derived from https://github.com/alexmasselot/benchmark-bitarray/blob/master/src/benchmark/bitarray/TimeIt.scala
def timeInMilli(n: Int, f: () => Unit) = {