Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GenIso.fields #297

Merged
merged 5 commits into from
Nov 22, 2015
Merged

Add GenIso.fields #297

merged 5 commits into from
Nov 22, 2015

Conversation

japgolly
Copy link
Contributor

Addresses #295.

Included is a benchmark for comparison with productToTuple.
I also took the liberty of upgrading JMH from 0.2.4 to 0.2.5 while I was there. Hope that's ok.

@japgolly
Copy link
Contributor Author

Benchmark results are in. It's looks to be around 2x ~ 4x faster on average.

Benchmark                       (pIsos)  (pSubject)  Mode  Cnt     Score     Error   Units
ProductIsoBench.get              fields       mono2  avgt   25    22.314 ±   0.115   ns/op
ProductIsoBench.get           shapeless       mono2  avgt   25    84.764 ±   0.681   ns/op
ProductIsoBench.get              fields       mono4  avgt   25    32.396 ±   0.644   ns/op
ProductIsoBench.get           shapeless       mono4  avgt   25   144.348 ±   0.753   ns/op
ProductIsoBench.get              fields       mono8  avgt   25    48.623 ±   0.275   ns/op
ProductIsoBench.get           shapeless       mono8  avgt   25   155.616 ±   6.728   ns/op
ProductIsoBench.get              fields       poly2  avgt   25    18.467 ±   0.108   ns/op
ProductIsoBench.get           shapeless       poly2  avgt   25    81.660 ±   0.292   ns/op
ProductIsoBench.get              fields       poly4  avgt   25    23.064 ±   1.233   ns/op
ProductIsoBench.get           shapeless       poly4  avgt   25   130.844 ±   2.786   ns/op
ProductIsoBench.get              fields       poly8  avgt   25    35.786 ±   0.103   ns/op
ProductIsoBench.get           shapeless       poly8  avgt   25   152.151 ±   0.463   ns/op
ProductIsoBench.reverseGet       fields       mono2  avgt   25    24.791 ±   0.590   ns/op
ProductIsoBench.reverseGet    shapeless       mono2  avgt   25    96.771 ±   1.465   ns/op
ProductIsoBench.reverseGet       fields       mono4  avgt   25    38.037 ±   0.237   ns/op
ProductIsoBench.reverseGet    shapeless       mono4  avgt   25    88.633 ±   0.413   ns/op
ProductIsoBench.reverseGet       fields       mono8  avgt   25    58.138 ±   0.347   ns/op
ProductIsoBench.reverseGet    shapeless       mono8  avgt   25   165.930 ±   0.450   ns/op
ProductIsoBench.reverseGet       fields       poly2  avgt   25    27.232 ±   3.852   ns/op
ProductIsoBench.reverseGet    shapeless       poly2  avgt   25    99.029 ±   0.799   ns/op
ProductIsoBench.reverseGet       fields       poly4  avgt   25    30.926 ±   1.935   ns/op
ProductIsoBench.reverseGet    shapeless       poly4  avgt   25   170.004 ±   1.840   ns/op
ProductIsoBench.reverseGet       fields       poly8  avgt   25    44.156 ±   0.111   ns/op
ProductIsoBench.reverseGet    shapeless       poly8  avgt   25   169.203 ±   7.615   ns/op

@@ -1,3 +1,5 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.5")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need scalajs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! That's a mistake; I'll remove that.

@julien-truffaut
Copy link
Member

It looks great but there seems to be an issue with scala 2.10

@japgolly
Copy link
Contributor Author

Oops, I didn't even realise that Scala 2.10 was choking and vomiting all over itself with the new macro. Lucky there's TravisCI, and thanks for pointing that out to me.

So, I've made the macros work with Scala 2.10, Travis is green and we should be good now. For reference I also opened a macro-compat ticket: milessabin/macro-compat#25

@julien-truffaut
Copy link
Member

Thank you very much! 👍

julien-truffaut added a commit that referenced this pull request Nov 22, 2015
@julien-truffaut julien-truffaut merged commit 2d53c85 into optics-dev:master Nov 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants