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

Poor compile time performance of shapeless.ops.record.{ Selector, Updater } #420

Closed
milessabin opened this issue Jun 23, 2015 · 1 comment
Labels

Comments

@milessabin
Copy link
Owner

Compile time scales super-linearly with number of case class members. This seems to account for most of the poor compile time performance of shapeless lens builders.

import shapeless._, record._

case class Foo(
  /*
  z0: Int,
  y0: Int,
  x0: Int,
  w0: Int,
  v0: Int,
  u0: Int,
  t0: Int,
  s0: Int,
  r0: Int,
  q0: Int,
  p0: Int,
  o0: Int,
  n0: Int,
  m0: Int,
  l0: Int,
  k0: Int,
  j0: Int,
  i0: Int,
  h0: Int,
  g0: Int,
  f0: Int,
  e0: Int,
  d0: Int,
  c0: Int,
  b0: Int,
  a0: Int,
  z: Int,
  */
  y: Int,
  x: Int,                                                                                                
  w: Int,                                                                                                
  v: Int,                                                                                                
  u: Int,                                                                                                
  t: Int,                                                                                                
  s: Int,                                                                                                
  r: Int,                                                                                                
  q: Int,                                                                                                
  p: Int,                                                                                                
  o: Int,                                                                                                
  n: Int,                                                                                                
  m: Int,                                                                                                
  l: Int,                                                                                                
  k: Int,                                                                                                
  j: Int,                                                                                                
  i: Int,                                                                                                
  h: Int,                                                                                                
  g: Int,                                                                                                
  f: Int,                                                                                                
  e: Int,                                                                                                
  d: Int,                                                                                                
  c: Int,                                                                                                
  b: Int,                                                                                                
  a: Int                                                                                                 
)                                                                                                        

object Test {                                                                                            
  val lgen = LabelledGeneric[Foo]                                                                        
  val foo: Foo = null                                                                                    
  val r = lgen.to(foo)                                                                                   

  r('a)                                                                                                  
  r.updated('a, 23)                                                                                      
}
@milessabin
Copy link
Owner Author

Fixed in d4c3c71.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant