buildableOfN currently uses Traversable.fill to build collections. Unfortunately, Traversable.fill eagerly generates the structure, which gets very expensive when generating deeply nested structures of unbounded size.
Optimally, element evaluation should be deferred until the element is requested so that nested structures are only created if they are actually inspected. It won't help with constrained generators, but it would be a useful optimisation for unconstrained generators.
buildableOfN
currently usesTraversable.fill
to build collections. Unfortunately,Traversable.fill
eagerly generates the structure, which gets very expensive when generating deeply nested structures of unbounded size.Optimally, element evaluation should be deferred until the element is requested so that nested structures are only created if they are actually inspected. It won't help with constrained generators, but it would be a useful optimisation for unconstrained generators.