Closed frankhaugen closed 3 years ago
Hi @frankhaugen
Unfortunately AutoBogus does have some performance issues when working with large and certain recursive object graphs. It is mainly due to the reflection involved in generating instance. I have been working on some caching strategies to speed things up, but it is still a WIP and due to other commitments, finding a lengthy amount of time to work on it is difficult.
I will continue to solve this issue, so watch this space for updates.
Nick.
@nickdodd79 okay, thanks for the explanation :-)
Hey @frankhaugen
A performance improvement has just been added to v2.13.0. Can you give it a run with your use case and see if it improves anything. You will need to use the WithTreeDepth
config handler.
Nick.
@nickdodd79
With a treedepth of four it took 8 seconds, 5 timed out at 30 seconds:
I'm happy 👍
I have an object/model/class that is generated with XSD from the UBL xsd for Invoice 2.1, (the generated file is 54'000 -ish lines, (or 1'200 individual classes after ReSharper have done it's magic).
I want to fake the object dynamically, because I don't want to do it manually, but my tests just times out, (using XUnit). If I use just the Faker from bogus it takes no time, but then it's basically useless unless I have hundreds of rules, making it easier to make manual fakes.
I really want to us AutoFaker for this as I love this tool, but it fails to work in this case. Is this a bug or is there some way to make this happen?