1

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.

TheMaster
  • 45,448
  • 6
  • 62
  • 85
dkuznietsov
  • 298
  • 1
  • 9
  • Please [edit](http://stackoverflow.com/posts/43463046/edit) the question to be on-topic: include a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) that duplicates the problem. Questions seeking debugging help ("why isn't this code working the way I want?") must include: (1) the desired behavior, (2) a specific problem or error and (3) the shortest code necessary to reproduce it in the question itself. Please also see: [What topics can I ask about here?](http://stackoverflow.com/help/on-topic), and [How to Ask](http://stackoverflow.com/help/how-to-ask). – MαπμQμαπkγVπ.0 Dec 17 '18 at 11:02

0 Answers0