Skip to content
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

Improve performance of VS Test results file parsing #586

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

tlecomte
Copy link

On a VS test result file containing many tests, the current code is pretty slow. This was observed when migrating a codebase from NUnit3 result files to trx.

Here we improve the performance by caching the parsing of the results:

  • a lookup of tests per feature
  • a dictionary of test results per test id

On a sample file with about 1000 tests, the performance improves from 40.2 seconds to 2.5 seconds.

This was tested with:

.\Pickles.exe -f xxx -o xxx --trfmt=vstest --enableComments=false -df=json -lr=xxx.trx

The resulting pickledFeatures.json file is identical to the one before these changes (except the GeneratedOn field).

@tlecomte tlecomte force-pushed the LargeVSTest branch 2 times, most recently from 079c504 to 8546bb9 Compare June 17, 2020 20:02
On a VS test result file containing many tests, the current code is pretty slow. This was observed when migrating a codebase from NUnit3 result files to trx.

Here, based on profiling, we improve the performance by caching the parsing of the results:
- a lookup of tests per feature
- a dictionary of test results per test id

On a sample file with about 1000 tests, the performance improves from 40.2 seconds to 2.5 seconds.

This was tested with:
```
.\Pickles.exe -f xxx -o xxx --trfmt=vstest --enableComments=false -df=json -lr=xxx.trx
```

The resulting `pickledFeatures.json` file is identical to the one before these changes (except the `GeneratedOn` field).
@tlecomte
Copy link
Author

Hello @dirkrombauts ! This is similar to #503 from 2 years ago, but for VS tests this time 😄

I've seen your message in the readme about your search for a new maintainer. I hope you'll be willing to accept this PR anyway!

@@ -33,7 +33,7 @@ namespace PicklesDoc.Pickles.TestFrameworks.UnitTests.VsTest
public class WhenParsingMultipleVsTestTestResultsFiles : WhenParsingTestResultFiles<VsTestResults>
{
public WhenParsingMultipleVsTestTestResultsFiles()
: base("VsTest." + "results-example-vstest - Run 1 (failing).trx;" + "MsTest." + "results-example-mstest - Run 2 (passing).trx")
: base("VsTest." + "results-example-vstest - Run 1 (failing).trx;" + "VsTest." + "results-example-vstest - Run 2 (passing).trx")
Copy link
Author

@tlecomte tlecomte Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way the feature names are found in VsTestElementExtensions.cs is now slightly more precise, which ended up catching this typo 😄

@dirkrombauts
Copy link
Member

@tlecomte thank you for your contribution!

I have moved away from Pickles. A while ago I wrote a message about it being time to hand over the torch.

You are still actively using Pickles, and just now wrote a contribution. Do you want to take over the project? I will give you full access to the repository and everything, and sign over the website domain to you.

@tlecomte
Copy link
Author

Thanks @dirkrombauts for the offer. Unfortunately I don't think I have enough time to step in. Really sorry !

@dirkrombauts
Copy link
Member

Too bad. I will merge the code into develop. I currently have no plan on when to release a new version.

@dirkrombauts dirkrombauts merged commit 579b5fe into picklesdoc:develop Jun 19, 2020
@dirkrombauts dirkrombauts mentioned this pull request Jul 14, 2020
@dirkrombauts
Copy link
Member

Released in version v2.21.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants