pholser/junit-quickcheck

Optimize GeneratorRepository#composeWeighted and #oneOf when only one generator matches

vlsi opened this issue · 3 comments

vlsi commented

Currently junitquickcheck produces CompositeGenerator all over the place even for cases when single generator is used (e.g. single @From).

That impacts performance, and it complicates analysis/debugging (extra CompositeGenerator wrapper object is present in debugger, yet it does not really matter)

@visi Understood. If I'm understanding correctly, the proposed change would be that if a generator search results in a single generator, junit-quickcheck should not wrap it in a composite?

vlsi commented

Yes. The proposed change is basically a single line change

@visi This should now be on both 0.9-branch and master.