@@ -3,7 +3,7 @@ package com.twitter.chill.java
33import java .util
44
55import com .esotericsoftware .kryo .Kryo
6- import com .esotericsoftware .kryo .io .{Input , Output }
6+ import com .esotericsoftware .kryo .io .{ Input , Output }
77import org .objenesis .strategy .StdInstantiatorStrategy
88import org .scalatest ._
99
@@ -63,19 +63,19 @@ class BitSetSpec extends WordSpec with MustMatchers {
6363 }
6464
6565 // warmup In case anybody wants to see hotspot
66- var lastBitSetFromOld : util.BitSet = null
67- for (i <- 0 to 50000 ) {
66+ var lastBitSetFromOld : util.BitSet = null
67+ for (i <- 0 to 50000 ) {
6868 lastBitSetFromOld = rt(element)(oldKryo)
6969 }
7070 var start = System .currentTimeMillis()
71- for (i <- 0 to 100000 ) {
71+ for (i <- 0 to 100000 ) {
7272 rt(element)(oldKryo)
7373 }
74- println(" The old serializer took " + (System .currentTimeMillis() - start)+ " ms" )
74+ println(" The old serializer took " + (System .currentTimeMillis() - start) + " ms" )
7575
76- var lastBitSetFromNew : util.BitSet = null
76+ var lastBitSetFromNew : util.BitSet = null
7777 // warmup for the new kryo
78- for (i <- 0 to 50000 ) {
78+ for (i <- 0 to 50000 ) {
7979 lastBitSetFromNew = rt(element)(newKryo)
8080 }
8181 // check for the three bitsets to be equal
@@ -87,23 +87,22 @@ class BitSetSpec extends WordSpec with MustMatchers {
8787 element.get(i) must be(lastBitSetFromNew.get(i))
8888 }
8989
90-
9190 start = System .currentTimeMillis()
92- for (i <- 0 to 100000 ) {
91+ for (i <- 0 to 100000 ) {
9392 rt(element)(newKryo)
9493 }
95- println(" The new serializer took " + (System .currentTimeMillis() - start)+ " ms" )
94+ println(" The new serializer took " + (System .currentTimeMillis() - start) + " ms" )
9695
9796 var out = new Output (1 , - 1 )
9897 oldKryo.writeObject(out, element)
9998 out.flush()
10099 var oldBytes = out.total()
101- println(" The old serializer needs " + oldBytes+ " bytes" )
100+ println(" The old serializer needs " + oldBytes + " bytes" )
102101 out = new Output (1 , - 1 )
103102 newKryo.writeObject(out, element)
104103 out.flush()
105104 var newBytes = out.total()
106- println(" The new serializer needs " + newBytes+ " bytes" )
105+ println(" The new serializer needs " + newBytes + " bytes" )
107106
108107 oldBytes >= newBytes must be(true )
109108 }
0 commit comments