Discard (and report) unused templates and functions on compilation
Just an idea, not sure if this will actually work without introducing unexpected behavior.
We may want to discard all templates (including ajax templates) and global functions that are unused for compilation. This is expected to reduce compilation time, especially when libraries of templates are plugged in that are not precompiled (such as elib at this moment).
For this to work, all pages and functions in app-files that are imported should be analyzed for template and function calls (also in action code)... recursively, until no new template/function reference is found. We may then discard all templates and functions that are not in this bag. For cases when templates can be loaded dynamically, there should be an option to guarantee compilation of specific units.
Or would this be fairly easy with Nabl?
This feature would also enable warnings on unused elements.Submitted by Elmer van Chastelet on 1 August 2013 at 15:09
I think we should rely on NaBL incremental name analysis to get incremental compilation. Doing an explicit traversal to check dependencies still requires visiting all template definitions, which will not scale.
Log in to post comments