This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ZipModelR[M, S, SS](root: ModelR[M, M], get1: M => S, get2: M => SS)(implicit cts: ClassTag[S], ctss: ClassTag[SS]) extends ModelR[M, (S, SS)] { | |
private var zipped = Tuple2[S, SS](null.asInstanceOf[S], null.asInstanceOf[SS]) | |
// ZipModel uses optimized `get` functions to compare if the contents of the tuple has changed or not | |
// Different comparison functions are used for boxed values and real references | |
private def getXX(compS: (S, S) => Boolean, compSS: (SS, SS) => Boolean)(model: M) = { | |
// check if inner references have changed | |
val v1 = get1(root.value) | |
val v2 = get2(root.value) | |
if (compS(zipped._1, v1) || compSS(zipped._2, v2)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1/18 : Encode single Seq[Int] | |
============================= | |
Library ops/s % size % size.gz % | |
BooPickle 146324 8.4% 2 100% 32 100% | |
Prickle 231064 13.2% 27 1350% 58 181% | |
uPickle 245188 14.1% 3 150% 35 109% | |
Circe 962996 55.2% 3 150% 35 109% | |
Pushka 1744486 100.0% 3 150% 35 109% | |
2/18 : Decode single Seq[Int] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CassandraWrapper { | |
import scala.language.implicitConversions | |
import scala.language.postfixOps | |
/** | |
* Converts a `ResultSetFuture` into a Scala `Future[ResultSet]` | |
* @param f ResultSetFuture to convert | |
* @return Converted Future | |
*/ | |
implicit def resultSetFutureToScala(f: ResultSetFuture): Future[ResultSet] = { | |
val p = Promise[ResultSet]() |
NewerOlder