Conversation
|
/azp run PR - Windows - Functional Tests |
|
Pull request contains merge conflicts. |
|
/azp run PR - Windows - Extra |
|
Pull request contains merge conflicts. |
becd8b0 to
0f9e40c
Compare
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
FWIW we went with having a custom exception type for the BlobSizes database ( |
wilbaker
left a comment
There was a problem hiding this comment.
Just a first set of comments on the database code specifically. I still need to review the tests, and how the new databases integrate with the rest of the codebase.
| command.Parameters.Add("@sha", SqliteType.Text).Value = placeholder.Sha; | ||
| } | ||
|
|
||
| command.ExecuteNonQuery(); |
There was a problem hiding this comment.
Have you tried measuring the performance impact of using prepared statements, and if so, what did you find?
There was a problem hiding this comment.
I did on the Contains method that I had and it did help. The issue here would be that you need to use the same connection that the prepare was ran against. This would require the class to keep connections around and do locking for using the commands that are prepared which would really add to the complexity so I will look into that after the PR is smoothed out.
There was a problem hiding this comment.
I also ran some testing using a simple locking strategy with one prepared connection and command and things were slowed down because of the lock. The next experiment will be to have a pool of prepared connections and commands to remove the need for the lock.
| namespace GVFS.UnitTests.Common.Database | ||
| { | ||
| [TestFixture] | ||
| public class PlaceholdersTests |
There was a problem hiding this comment.
This class goes a little mock crazy so I'm not sure the value this brings vs the maintenance cost of all the mocking it is doing.
|
/azp run |
|
Azure Pipelines successfully started running 5 pipeline(s). |
|
/azp run PR - Windows - Functional Tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@kewillford What's the status here. Are you still doing investigations? I think this is good to go, and it's probably best to let it simmer in CI before a release. |
|
@derrickstolee, @wilbaker was going to take another look today. |
wilbaker
left a comment
There was a problem hiding this comment.
Posting comments so far, I still need to review:
- Test files
- The rest of
GVFSDatabase.cs - PlaceholderTable.cs
wilbaker
left a comment
There was a problem hiding this comment.
I still need to review the tests, but wanted to post the rest of my comments on the product changes first.
wilbaker
left a comment
There was a problem hiding this comment.
Adding comments on the functional test changes, reviewing the unit tests now.
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/DiskLayoutUpgradeTests.cs
Outdated
Show resolved
Hide resolved
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/DiskLayoutUpgradeTests.cs
Show resolved
Hide resolved
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/MacDiskLayoutUpgradeTests.cs
Outdated
Show resolved
Hide resolved
wilbaker
left a comment
There was a problem hiding this comment.
Just a few more comments on the Unit Tests
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/DiskLayoutUpgradeTests.cs
Outdated
Show resolved
Hide resolved
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/DiskLayoutUpgradeTests.cs
Outdated
Show resolved
Hide resolved
wilbaker
left a comment
There was a problem hiding this comment.
Approved with a few more minor non-blocking comments (posted earlier today)
|
I'm a bit late to the party, but do we have some performance numbers here? How was the old placeholder DB performing and by how much the SQLite solution improves it? |
|
@turbonaitis here are some number with ~1 million placeholders OldLoad and get all placeholders: SQLiteLoad and get all placeholders: |
I think this is far enough along to start taking a look at. There is a lot of new code to handle the sqlite database but the other changes should be minimal.
I would like to get some feedback on how I am setting up the class for the connection and the class for the Placeholders table. Something to keep in mind is if we are going to add ModifiedPaths to this same database, does this make it easy or is there a better way?
Currently it is structured with a
GVFSDatabaseclass that initializes the database and keeps a pool of connections for consumers to use. The connection is wrapped in a class that implementsIDbConnectionso that theDisposemethod can return the underlying connection to the pool. Like the following:Another question is also how we show handle exceptions. The
FileBasedCollectionwould have try catches and throw a customFileBasedCollectionException. Should we be doing something similar for SQLite or just let exceptions bubble up?Changed the
Countproperty to be a method because it is now running a SQLite query and will take longer than returning a value and it being a method makes that more obvious.Removed some constructors that caused me some confusion when I was adding the
IPlaceholderDatabaseas a parameter but I'm open to adding them back in if they make sense.The most critical part to review would be the changes in
GitIndexProjection.TODO: