Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Fix to improve performance of ChangesTreeView #119

Merged
merged 9 commits into from
Jul 31, 2017

Conversation

StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Jul 11, 2017

Attempted #23

performance test used pumps two sequences into TreeBuilder.BuildTreeRoot():

  1. Simple Test
    a. The first sequence contains 200 GitStatusEntry objects.
    1. There are 10 folders, with 10 files and 10 meta files.
      a. The second sequence contains 300 GitStatusEntry objects.
    2. Out of the original dataset every other file is retained.
      a. There are 10 folders, with 5 files and 5 meta files.
      a. Half of the original files can be considered "removed".
      a. An additional 10 folders, with 10 files and 10 meta files.
  2. Advanced Test
    a. The first sequence contains 800 GitStatusEntry objects.
    1. There are 20 folders, with 20 files and 20 meta files.
      a. The second sequence contains 1200 GitStatusEntry objects.
    2. Out of the original dataset every other file is retained.
      a. There are 10 folders, with 10 files and 10 meta files.
      a. Half of the original files can be considered "removed".
      a. An additional 20 folders, with 20 files and 20 meta files.
Method Mean Error StdDev
Basic Test - Currently 70.71 ms 1.3993 ms 1.3743 ms
Basic Test - PR 26.77 ms 0.6483 ms 0.6657 ms
Heavy Test - Currently 754.46 ms 6.6629 ms 5.9064 ms
Heavy Test - PR 110.11 ms 2.1563 ms 2.2143 ms

This branch will let you reproduce the performance test framework:
https://github.com/github-for-unity/Unity/tree/fixes/changes-view-performance-proof
Run the PerformanceTest project un-attached in Release mode.
It will take approx 8-9 minutes to complete.

Overall the PR starts at a third of the time of the current code base, and the amount of time it takes to execute grows bu half of the current code base.

Depends on:

                       Method |     Mean |    Error |   StdDev |
----------------------------- |---------:|---------:|---------:|
 OriginalTreeBuilderBenchmark | 65.67 ms | 1.296 ms | 1.730 ms |
  CurrentTreeBuilderBenchmark | 55.80 ms | 1.102 ms | 1.683 ms |
@StanleyGoldman StanleyGoldman changed the base branch from master to fixes/changes-view-refactoring July 11, 2017 20:40
                       Method |     Mean |     Error |    StdDev |
----------------------------- |---------:|----------:|----------:|
 OriginalTreeBuilderBenchmark | 61.32 ms | 0.8018 ms | 0.7500 ms |
  CurrentTreeBuilderBenchmark | 42.24 ms | 0.8295 ms | 1.0786 ms |
                       Method |     Mean |     Error |    StdDev |
----------------------------- |---------:|----------:|----------:|
 OriginalTreeBuilderBenchmark | 63.59 ms | 0.9887 ms | 0.9248 ms |
  CurrentTreeBuilderBenchmark | 24.41 ms | 0.4952 ms | 0.7854 ms |
@StanleyGoldman
Copy link
Contributor Author

https://gist.github.com/StanleyGoldman/c84e31e174a91e1ff28770feaaf8da29

I've been using this python script to generate data to test with, this is an improvement, but I definitely feel the need for more.

# Conflicts:
#	src/GitHub.Api/UI/TreeBuilder.cs
…-performance

# Conflicts:
#	src/GitHub.Api/UI/TreeBuilder.cs
…-performance

# Conflicts:
#	src/GitHub.Api/UI/TreeBuilder.cs
Copy link
Member

@shana shana left a comment

Choose a reason for hiding this comment

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

Nice numbers!

@StanleyGoldman
Copy link
Contributor Author

It's an nice improvement, but it doesn't solve the overall performance issues.

@StanleyGoldman StanleyGoldman changed the base branch from fixes/changes-view-refactoring to master July 31, 2017 14:41
@StanleyGoldman StanleyGoldman merged commit 88adbf1 into master Jul 31, 2017
@StanleyGoldman StanleyGoldman deleted the fixes/changes-view-performance branch July 31, 2017 14:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants