Art-Stea1th / Enhanced-Syntax-Highlighting

[Marketplace] Lightweight "editor classifier extension" for Visual Studio based on the async Roslyn APIs to enhanced highlighting custom tags in C# code.
https://marketplace.visualstudio.com/items?itemName=StanislavKuzmichArtStea1th.EnhancedSyntaxHighlighting
Other
77 stars 10 forks source link

Fix: improve performance #13

Closed Spaier closed 6 years ago

Spaier commented 6 years ago

Tried to increase performance with:

  1. Using PLINQ instead of LINQ.
  2. Removing redundant list creation because we can just use ToList().
  3. Using Task.WhenAll to parallelize task execution. While ConfigureAwait(false) caused to continue execution of other threads, 3 tasks weren't executed in parallel. Visualization of how ConfigureAwait(false) works: https://blogs.msdn.microsoft.com/benwilli/2015/09/10/tasks-are-still-not-threads-and-async-is-not-parallel/
Art-Stea1th commented 6 years ago

Hi, thank you, it looks good, I'll to check all before the weekend using "Performance Profiler" and merge this changes if the result will take a positive effect.

Art-Stea1th commented 6 years ago

Thank you for the contribution, the code became more concise, but the changes did not affect the performance. Therefore, these changes will not lead to the release of the new version.