Recently, while searching for means to improve performance of my Gmail Add-on, I came across a certain question comments to which noted that:
Note that libraries and globals are evaluated every time your add on runs any function
I started testing it out and noticed that while debugging, this
property of function besides globals and libraries objects contained module
and exports
properties which contained all exported (and maybe even all) functions. i'm using Typescript so exports are the way to reach modularity for me, but as far as I know clasp
doesn't really compile my Typescript.
That is, I'd like to know following topics:
1) Are really exported functions evaluated? What does this mean in particular?
2) Which functions are exactly evaluated? All or only exported ones? Which functions should be exported?
3) Do these rules apply to nested function calls? Say, i perform a map
function over an array. Does context get evaluated each time passed function is called?
Also I'd really like to get a general advice of how to improve my Add-on performance. Are there any guides besides developers.google.com guides?
Thanks in advance.