Alternative method of rendering custom classes into the OST

Issue #894 resolved
Scott Wells repo owner created an issue

In orgs with large installed managed packages and/or high quantities of custom Apex classes, the majority of time during full OST generation is spent loading metadata about those custom Apex classes to render a high-fidelity OST. This is for a variety of reasons including a service protection which prevents parallelization when querying symbol tables for these classes and the need for a slow undocumented API in order to "fill in the gaps" to achieve the desired level of fidelity.

I'm toying with an alternative approach to loading that information that I'm hoping will be considerably faster in these types of orgs. Using this issue to track that progress and to make test builds available to folks who want to help quantify gains.

Official response

  • Scott Wells reporter

    In a perfect world, here's what I'd love for folks to do to help with benchmarking and validation of the new approach vs. the old approach:

    Before doing anything else, enable debug logging for OST generation by adding the following to Help>Debug Log Settings:

    #com.illuminatedcloud.intellij.settings.project.OfflineSymbolTableGenerator
    #com.illuminatedcloud.symtab.OfflineSymbolTable
    #com.illuminatedcloud.symtab.SystemDeclarations
    #com.illuminatedcloud.symtab.ApexClassSymbolTableAdapter
    #com.illuminatedcloud.symtab.TypeDeclarationGenerator
    
    1. With the latest official plugin release, generate the OST and save off the resulting idea.log file(s) from the OST generation timeframe (there may be multiple; you can find them using Help>Show Log in Explorer/Finder/Files) as the "before" log. Also make a copy of OfflineSymbolTable.zip from the run above and save it off as the "before" OST.
    2. Install the appropriate test build attached here using the instructions above.
    3. Generate the OST and save off the resulting idea.log file(s) and OfflineSymbolTable.zip as the "after" log and OST.
    4. Email me the before and after logs so I can compare timings. Ideally send me the two OST archives as well so I can make sure that there is no material loss of details, but I understand if you'd prefer not to share full OSTs.

    Thanks much for helping to gather information on this before I release it into the wild!

Comments (6)

  1. Scott Wells reporter

    This is a test build of IC2 with this alternative method of rendering custom classes. Given its nature, bugs are possible/likely.

    To install the build, download the archive and use Settings>Plugins>Install plugin from disk.

    After installing, please open a project and perform a full regen on its OST. Hopefully it'll go much more quickly than before. After it has regenerated, make sure that classes from installed managed packages and/or classes which are in the org but not part of the local project's source are in the OST properly.

    If you don't mind, also please send over your idea.log (Help>Show Log in Finder/Explorer/Files) so I can take a look. I'll be interested to know comparative times, this build vs. the standard build.

    Needless to say, if there are bugs/issues, let me know and I'll address them. You can also revert to the standard build by uninstalling this one and installing from the plugin repository.

  2. Scott Wells reporter

    In a perfect world, here's what I'd love for folks to do to help with benchmarking and validation of the new approach vs. the old approach:

    Before doing anything else, enable debug logging for OST generation by adding the following to Help>Debug Log Settings:

    #com.illuminatedcloud.intellij.settings.project.OfflineSymbolTableGenerator
    #com.illuminatedcloud.symtab.OfflineSymbolTable
    #com.illuminatedcloud.symtab.SystemDeclarations
    #com.illuminatedcloud.symtab.ApexClassSymbolTableAdapter
    #com.illuminatedcloud.symtab.TypeDeclarationGenerator
    
    1. With the latest official plugin release, generate the OST and save off the resulting idea.log file(s) from the OST generation timeframe (there may be multiple; you can find them using Help>Show Log in Explorer/Finder/Files) as the "before" log. Also make a copy of OfflineSymbolTable.zip from the run above and save it off as the "before" OST.
    2. Install the appropriate test build attached here using the instructions above.
    3. Generate the OST and save off the resulting idea.log file(s) and OfflineSymbolTable.zip as the "after" log and OST.
    4. Email me the before and after logs so I can compare timings. Ideally send me the two OST archives as well so I can make sure that there is no material loss of details, but I understand if you'd prefer not to share full OSTs.

    Thanks much for helping to gather information on this before I release it into the wild!

  3. Log in to comment