Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Use Serialized Projects for faster Startup #3483
As an alternative to some of my impossible requests in #3041:
Allow for an option to enable Rubberduck to serialize and cache its understanding of libraries/projects on disk. This makes reopening a large project that contains a lot of 3rd party COM references or AddIns easier.
I'm okay with waiting 10 minutes for Rubberduck to parse my 3rd party libraries once and then allow Rubberduck on future loads to only have to parse the active project but still retain knowledge about everything from what it learned the first time it parsed everything.
Thing is, we already can load the COM declarations from serialized xml files when they exist, but that is actually slower than just loading the COM library and reflecting it... So it was never put in a release build. If you have a fork/clone you can experiment with a debug build.
Just for reference, the libraries referenced by the projects should not be the problem here. COM reflecting those takes 2s MAX, i.e. for VBA, the Excel object model, Scripting and ADO.
The real problem are 3rd party add-ins whose code is visible in a project in the VBE. These get parsed the usual way and then even inspected. Since the user is not meant to change the code, parsing every VBE session is wasteful and inspecting these projects after every parse is just useless; it probably also produces a lot of clutter in the inspection results window.
I would like to repeat here my proposed solution from the original issue: we could introduce a new menu to manage serialized/saved projects. There, one would be able to save projects to file and mark projects to be loaded from file. Then, the marked projects would be loaded from file during the parsing process, maybe right after the COM references. To keep the projects out of the inspection process, they should all have
Please note that, though declaration serialization has been implemented already, this will require some effort. It will require changes to the parsing process, a UI, settings to remember both the file paths of known serialized projects and the choice of whether to use them.