He discusses some of his findings in performance such as, the Plaxo team found that in some cases they could achieve substantial gains by attaching event handlers inline using DOM level 0 syntax (e.g. <div onclick=”someGlobalFunction();”>) rather than attaching them via DOM level 2â€™s favored addListener.
This is very much a micro-benchmark, and if that is the source of your performance issues, you are a lucky man ;)
In sum, Joseph argues for a four-point approach to achieving maximum performance in your web-app:
- Be lazy: Donâ€™t load or do things before you need to; maybe you wonâ€™t need to load or do them at all.
- Be responsive: Make things happen quickly. If you can shave 100ms off of an interaction by responding to a mousedown event instead of a click event, do it.
- Be pragmatic: Frontend engineering is hard enough. Donâ€™t make it harder than it needs to be.
- Be vigilant: Blank web pages are fast. Web pages become slow because you put stuff in them; slowness is your resonsibility. Vigilance is required to prevent slowness.
Posted by Dion Almaer at 6:48 am