You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RefineJavapSpec.scala shows the boxing behavior and runtime overhead of the different refinement carrier that refined supports which are currently Refined, shapeless.tag.@@, and scalaz.@@ (via the refined-scalaz module).
For reference types, all three carrier types do not box but using Refined causes an additional function call. For value types only shapeless.@@ does not seem to box but causes two additional function calls. While the runtime overhead of shapeless.tag.@@ and scalaz.@@ is lower than for Refined, the latter is less susceptible to compiler bugs and quirks like:
@carymrobbins Unboxed primitives sounds great and the subtyping relation fits well for refinement types. I'll will definitely try that for refined. There is no hurry to cut a release from my side, It'll take a me little while before I can do these experiments.
RefineJavapSpec.scala shows the boxing behavior and runtime overhead of the different refinement carrier that refined supports which are currently
Refined
,shapeless.tag.@@
, andscalaz.@@
(via the refined-scalaz module).For reference types, all three carrier types do not box but using
Refined
causes an additional function call. For value types onlyshapeless.@@
does not seem to box but causes two additional function calls. While the runtime overhead ofshapeless.tag.@@
andscalaz.@@
is lower than forRefined
, the latter is less susceptible to compiler bugs and quirks like:shapeless.tag.@@
does not work with aliases)shapeless.tag.@@
andscalaz.@@
does not work reliably)We should experiment if @alexknvl's https://github.com/alexknvl/newtypes or @carymrobbins https://github.com/estatico/scala-newtype could provide a viable replacement for
Refined
with lower (or zero) runtime overhead.The text was updated successfully, but these errors were encountered: