Performance (userscripts)

Runtime performance

  • Image size -> {Use smaller images, Use slices of larger images}
  • Consider model itself {Model parameters}
  • Setup - > Cache models
  • Post processing
    For example how many instances are being created? Is the right instance type used?
  • End user system hardware.


First run vs ongoing

Many models have a "slow first run". For example the first run may be on the order of seconds (download weights, build model, run), where as subsequent runs are 1/10 the time.

Development performance

In addition to runtime concerns, when developing consider

  • Logging large data structures, or high volume of data is costly
  • In general, if devtools are open performance is lower

More reading

Tensorflow JS