Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
Fix performance issue (generation of Pickler[Any])
Browse files Browse the repository at this point in the history
* When generating (un)picklers, most of the time we look for the pickler
  of `Any`. By exposing the pickler of `Any`, we don't manually create
  one pickler/unpickler every time it's needed. This speeds up the
  compilation time almost by a factor of 2.
  • Loading branch information
jvican committed Apr 18, 2016
1 parent eaa7c2a commit 48e1c4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/scala/pickling/pickler/Any.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ object AnyPicklerUnpickler extends AbstractPicklerUnpickler[Any]
}

trait AnyUnpicklers {
implicit val anyUnpickler: Unpickler[Any] = AnyPicklerUnpickler
implicit val anyPicklerUnpickler: AbstractPicklerUnpickler[Any] = AnyPicklerUnpickler
}
1 change: 1 addition & 0 deletions core/src/test/scala/pickling/run/share-binary-any.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ShareBinaryAnyTest extends FunSuite {

intercept[StackOverflowError] {
import shareNothing._
implicit val pu = PicklerUnpickler.generate[C]
c1.c = c3
(c2: Any).pickle
}
Expand Down

0 comments on commit 48e1c4d

Please sign in to comment.