How to write Performant JavaScript- Mark Nadal

Опубликовано: 23 Сентябрь 2016
на канале: UtahJS
3,432
80

www.utahjs.com

2016 UtahJS Conference
Friday, September 16, 2016

Slides: https://docs.google.com/presentation/...

Time ran out quickly, let's reiterate the important take aways of the talk: 1 Test instead of trusting ""best practices"" (see below for how). 2 Do not get lost in micro optimizations but also do not ignore performance testing, use PTSD like you would TDD.

How to easily test? Unfortunately JSPerf does not work any more, so here is an offline version http://db.marknadal.com/ptsd/ptsd.html (it comes pre-filled with the tests from the talk, but you can easily just copy&paste code in and hit ""run"").

What is PTSD? Performance Testing Speed Development is a development philosophy like TDD that lets you include performance optimizations into your code, but without the distraction or debate. Most people avoid performance testing entirely because of the subjective nature of micro optimizations (we've repeatedly seen inconsistencies in Chrome over just a few months, let alone Firefox and others), however this leads to a dangerously ignorant community - but science can be on our side! The rule to performance testing is simple: Paste in a couple variations of code, run them, choose the winner (or the fastest of the most readable ones), get back to work.

We have seen significant gains in our Open Source Firebase product ( http://gun.js.org/ ) using these techniques, achieving 30M+ ops/sec ( see https://github.com/amark/gun/wiki/100... ). You too can apply PTSD and squeeze reasonable results out without the pain or debate.


Смотрите видео How to write Performant JavaScript- Mark Nadal онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь UtahJS 23 Сентябрь 2016, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,432 раз и оно понравилось 80 людям.