trivago / cluecumber

Clear and concise reporting for the Cucumber BDD JSON format.
https://www.softwaretester.blog
Apache License 2.0
271 stars 88 forks source link

Report generation very slow #343

Closed simonstratmann closed 4 months ago

simonstratmann commented 4 months ago

Describe the bug We have tests that result in 5k JSON with a total size of 71MB. Many tests use the same steps. Report generation takes about 6 minutes on my high-end PC and 15-20 on our cluster. I profiled the code and a significant amount of the time goes to the calls of com.trivago.cluecumber.engine.json.pojo.Step#returnNameWithArgumentPlaceholders. This is exacerbated by equals() calling that method as well.

To Reproduce I guess profile a report generation where many tests use the same step.

Expected behavior Caching should help.

I did a quick-fix here: https://github.com/simonstratmann/cluecumber/commit/02b4b9086a4f79c5209b29056f5608b9658353b7 and reduced the local running time from 6 minutes to 90 seconds.

Attachments Sorry, can't provide any examples as it's company stuff.

Profiling result: image

bischoffdev commented 4 months ago

Thank you for reporting this. We usually have reports that take a few seconds max to complete with our 300 to 500 JSON files so we weren't aware about this. I will try this out and include this in 3.6.3.

simonstratmann commented 4 months ago

Thank you.

If I've learned one thing in my career it's that customers' numbers will always wildly exceed what you'd expect (or perhaps even consider reasonable).

bischoffdev commented 4 months ago

v3.6.3 is released and should show up on Maven Central soon. Thanks a lot for the contribution!

bischoffdev commented 4 months ago

By the way, @simonstratmann , what did you use for profiling? JProfiler, Yourkit or something else?

simonstratmann commented 4 months ago

I use JProfiler for everything. I have an open source license for a project of mine but I guess for something like this the IntelliJ profiler may be enough.