Skip to content

Performance Design Guidlines

Vlad Balin edited this page May 25, 2015 · 6 revisions
  • Model.attributes and __attributes must be an object. Avoid operations and approaches deoptimizing it to hash.
    • don't delete elements
    • all known elements must be initialized in constructor in the same order.
    • always use dedicated constructors for copy and creation.
  • Avoid generic functions, rely on attribute and model type information whenever possible.
  • Don't write to function arguments, avoid passing 'arguments' through.
  • Avoid exceptions
  • Avoid polymorphic functions and calls, if it's not absolutely necessary. Both, ad-hoc and parametric.
  • Use duplicated specialized functions for hot spots.
  • Use loop unrolling with compilation to Function for hot spots.
  • Avoid long functions
  • 1
  • 2
  • 3
Clone this wiki locally