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
// The problem, I believe, was doing `inConfig(hconfig)(Defaults.defaultSettings + other settings) `, therefore kill the project | |
// setup in the hconfig. Btw, h stands for hibernate (ergh) config. I wanted a shell where it'd be easy to play with hibernate | |
project.in(file(".")). | |
configs(hconfig). | |
settings(inConfig(hconfig)(Defaults.configTasks) : _*) | |
.settings( | |
fork.in(hconfig,console) := true, | |
initialCommands in hconfig := | |
""" |
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
// FINE! | |
@reports.zip(exec.Comparisons2.totalTimeColors).map { case (r@ElapsedTimeOf(title, elapsed ),color) => | |
@{oneSeries(elapsed.time, title, "column", color, 0)} | |
}.reduce(_ + (new Html(",")) + _) | |
--------------- | |
// BAD! -> | |
@reports.zip(exec.Comparisons2.totalTimeColors).map { |
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 Other2 { | |
import scalaz._ | |
import Scalaz._ | |
import scalaz.syntax._ | |
case class ElapsedTime[A](time: A) | |
object ElapsedTime { | |
type O[CC[_]] = { | |
type λ[A]=ElapsedTime[CC[A]] | |
} |
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 YetAnother2 { | |
import scalaz._ | |
import Scalaz._ | |
case class ElapsedTime[A, CC[_]](time: CC[A]) | |
object ElapsedTime { | |
type ET_A[CC[_]] = { | |
type λ[A]=ElapsedTime[A, CC] | |
} | |
type NEL[A] = NonEmptyList[A] |
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
case class ElapsedTime[CC[_]](time: CC[Chronon]) { type HK[a] = CC[a] } | |
object ElapsedTime { | |
class ETFunctor[CC[_]](implicit evf: Functor[CC]) | |
extends Functor[({type λ[α]=ElapsedTime[CC]})#λ] | |
// Functor[ElapsedTime[CC]#HK] | |
{ | |
def map[A, B](fa: ElapsedTime[CC])(f: Chronon => Chronon): ElapsedTime[CC] = ElapsedTime(evf.map(fa.time)(f)) | |
} | |
} |
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
trait EntityBase { | |
def id: String | |
} | |
trait Repository { | |
type Entity <: EntityBase | |
def get(id: String): Option[Entity] | |
} |
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
@reports map { case(r@Report(title, lines, _)) => | |
{ | |
name: '@title', | |
color: '#4070A0', | |
type: 'column', | |
yAxis: 0, | |
//data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], | |
data: [ @lines.map{ case ReportLine(rows, time, timeUnit) => @time }.mkString(",") ], | |
tooltip: { valueSuffix: ' µs' } | |
} |
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
[info] Running jpaperf.Main | |
-- Inserting | |
[info] # of Rows: 1, totalTime: 39724 μs, time per row: 39724.0 μs | |
[info] # of Rows: 10, totalTime: 32630 μs, time per row: 3263.0 μs | |
[info] # of Rows: 20, totalTime: 55624 μs, time per row: 2781.2 μs | |
[info] # of Rows: 30, totalTime: 79954 μs, time per row: 2665.1333 μs | |
[info] # of Rows: 40, totalTime: 99999 μs, time per row: 2499.975 μs | |
[info] # of Rows: 50, totalTime: 118572 μs, time per row: 2371.44 μs | |
[info] # of Rows: 100, totalTime: 217274 μs, time per row: 2172.74 μs | |
[info] # of Rows: 200, totalTime: 420907 μs, time per row: 2104.535 μs |
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
[info] Running jpaperf.Main | |
[info] Inserting users with one account each | |
[info] Rows: 1, totalTime: 39161 μs, time per register: 39161.0 μs | |
[info] Rows: 10, totalTime: 31550 μs, time per register: 3155.0 μs | |
[info] Rows: 20, totalTime: 58404 μs, time per register: 2920.2 μs | |
[info] Rows: 30, totalTime: 75291 μs, time per register: 2509.7 μs | |
[info] Rows: 40, totalTime: 93540 μs, time per register: 2338.5 μs | |
[info] Rows: 50, totalTime: 109259 μs, time per register: 2185.18 μs | |
[info] Rows: 100, totalTime: 206513 μs, time per register: 2065.13 μs | |
[info] Rows: 200, totalTime: 418894 μs, time per register: 2094.47 μs |
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
scala> val sample = "A" :: 1 :: 2L :: HNil | |
sample: shapeless.::[String,shapeless.::[Int,shapeless.::[Long,shapeless.HNil]]] = A :: 1 :: 2 :: HNil | |
scala> object bleh4 extends Poly1 { | |
| implicit val caseInt = at[Int](_.toString); | |
| implicit val caseLong = at[Long](_.toString); | |
| implicit val caseStr = at[String](_.toString); | |
| } | |
defined module bleh4 |