Skip to content

Defer loading of SQLite binaries until they will be used #26269

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

Merged
merged 1 commit into from
Apr 21, 2018

Conversation

sharwell
Copy link
Contributor

@sharwell sharwell commented Apr 19, 2018

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/594591

Customer scenario

When opening a small solution, SQLite assemblies are loaded by Visual Studio even though they are not used. In aggregate, assembly loads like this cause delays for users trying to simply open their solution for editing.¹

¹ We don't have evidence of the assemblies here being a direct problem, but this is a general explanation for why we look for the total number of assembly loads as part of the product performance regression test suite.

Bugs this fixes

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/594591

Workarounds, if any

None needed (no functional/behavioral change).

Risk

Low. The initialization code is the same as before and only runs once, but is relocated to follow some fast-path checks for small solutions.

Performance impact

Improves performance when opening solutions that do not exceed the solution size threshold for persisting data.

Is this a regression from a previous update?

Yes. Introduced by #25590.

Root cause analysis

Caught by RPS.

How was the bug found?

RPS.

Test documentation updated?

N/A

@sharwell sharwell added this to the 15.7 milestone Apr 19, 2018
@sharwell sharwell requested a review from heejaechang April 19, 2018 20:15
@sharwell sharwell requested a review from a team as a code owner April 19, 2018 20:15
@@ -88,6 +88,13 @@ protected override string GetDatabaseFilePath(string workingFolderPath)
protected override bool TryOpenDatabase(
Solution solution, string workingFolderPath, string databaseFilePath, out IPersistentStorage storage)
{
if (!TryInitializeLibraries())
Copy link
Contributor

Choose a reason for hiding this comment

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

hey. turns out not that bad!

@sharwell sharwell changed the title [WIP] Defer loading of SQLite binaries until they will be used Defer loading of SQLite binaries until they will be used Apr 19, 2018
@CyrusNajmabadi
Copy link
Member

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/594591
Customer scenario

When opening a small solution, SQLite assemblies are loaded by Visual Studio even though they are not used. In aggregate, assembly loads like this cause delays for users trying to simply open their solution for editing.

can you give info on what sort of impact this was? I'm surprised RPS didn't complain if this does impact things.

@sharwell
Copy link
Contributor Author

@CyrusNajmabadi There was no measured impact. This is a generic statement on the basis for RPS checking assembly loads.

@CyrusNajmabadi
Copy link
Member

Ah, i see. That matches my recollection as well that this was paid for by not having esent. But, i'm totally for deferring unnecessary work. I just misinterpretted the statements above. Thanks for the clarification!

@CyrusNajmabadi
Copy link
Member

Do you think there's any way to write a test for this? It seems super simple to accidentally regress this sort of thing.

@sharwell
Copy link
Contributor Author

@CyrusNajmabadi RPS is the regression test here

@CyrusNajmabadi
Copy link
Member

I just meant something faster than that for the team. something we could catch at CI time versus potentially months later as builds RI and whatnot.

@Pilchie
Copy link
Member

Pilchie commented Apr 20, 2018

Thanks for addressing!

@jinujoseph
Copy link
Contributor

sorry wrong button
approved to merge via link for 15.7.Preview5

@sharwell sharwell merged commit bf96002 into dotnet:dev15.7.x Apr 21, 2018
@sharwell sharwell deleted the defer-initialization branch April 21, 2018 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants