-
-
Notifications
You must be signed in to change notification settings - Fork 293
* use producer consumer pattern for parsing and merging #262
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
Conversation
Lorilatschki
commented
Jul 4, 2019
- added setting to define parallel merge count
- optimized open cover parsing
- added timestamp to logging
- made logging to console non blocking
* added setting to define parallel merge count * optimized open cover parsing * added timestamp to logging * made logging to console non blocking
I will review and merge this PR within the next 1-2 weeks. |
I have added a producer which first reads the content of each file and adds this content to a blocking queue. This can be controled by 'NumberOfReportsReadOnMemoryInParallel'. A set of producer (amount can be controled by NumberOfReportsParsedInParallel) listens to this collection an creates ParserResults out of that. The parser results are also added to a second blocking collection. A set of consumer (can be controled by 'NumberOfReportsMergedInParallel') listens to that queue and merges the content of the previously created parser results. At the end each parser result of the merge consumer are als merged together to a final result. |
I justed started to review and merge your PR. Some notes so far:
|
Regarding the ConcuentBag, please revert it.
We are investigating in finding both, the bottleneck and the memory leak. The GC.Collect was just helpful during analyzing. This should not be merged to master.
We are currently analyzing the XDocument regarding performance and memory consumption.
… Am 15.07.2019 um 22:29 schrieb Daniel Palme ***@***.***>:
I justed started to review and merge your PR.
Some notes so far:
In Assembly.cs you are now using a ConcurrentBag. This was a ConcurrentBag in the past until I switched to a simple List. Reason: The ConcurrentBag caused a memory leak (see your issue: #126)
PerformanceInfo.cs uses psapi.dll internally. This will probably not work on Linux/macOS. I'm not sure if ReportGenerator should force GC. Perhaps the memory usage is caused by the `ConcurrentBag?! If we really not to force GC, we have to find a platform independent solution to calculate memory usage.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ok, I reverted those changes. Now I'm looking at I'm not sure, but I guess that will consume quite a lot extra memory in comparison to |
This was just a try to get the cpu workload to 100%. But what ever we tried, we were not able to get it over 33%. But even when loading all the content in memory, creating separat xDocuments out of it and parse them does not lead to a scaling algorithm. You can also revert this change as this seems not to be the bottleneck during file parsing. |
First analyzing results:
|
Let me know when you have first results. I'm interested in the numbers! |
First figures:
Since the parallel foreach inside the parser scales automatically, the optimal settings could slightly differ depending on the physical hardware the generator is executed on. As the figures above shown, there is a peek from which the algorithm not scale anymore, because the harddisk seems to be penetrated to much. Maybe I need to introduce the parallel foreach restriction again, in order to only scale by the number of ParserResult Producers. I will continue playing around with the settings. The figures from our build agents are not yet finished. Will post this until friday. We are still looking for performance inprovements inside the OpenCoverParser. For now we are finished with this pull request. It would be great if you can review it and merge it to master as well as providing a new nuget package. Attached you find a dotTrace measurement ReportGenerator.zip. |
Update 1: Found some improvements in the opencover parser itself. 342f329
|
Update 2: Enabled historic file parse to run in parallel fabbe42 |
Update 3: Found another easy performance improvement inside the histroy parser 7838be3 |
I just merged your changes into the performance branch. If you plan to make further changes, you should first merge performance branch into your master branch. I'm currently planning to include your changes in version 4.3 of ReportGenerator. |
Published a first version containing the performance improvements: |
Thanks for that. First run's passed so far! |
Hi @danielpalme @LymanZerga - thanks for your work! Regarding the removal of |
@nikosatwork |
this was not intended. @daniel: could you please add this back to the master branch?
… Am 14.10.2019 um 13:15 schrieb Daniel Palme ***@***.***>:
@nikosatwork
Correct. I'm not sure if that was intended.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Done (see 1f42d7b) |
Thanks. I guess this is going to v4.3.1? |