Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Measuring Performance of AngularJS applications
Search
Kenneth Auchenberg
December 11, 2015
Programming
1
620
Measuring Performance of AngularJS applications
Opbeat for AngularJS
Kenneth Auchenberg
December 11, 2015
Tweet
Share
More Decks by Kenneth Auchenberg
See All by Kenneth Auchenberg
BUILD 2017: Supercharge your JavaScript debugging workflow with VS Code 🔥
auchenberg
0
350
A future without browsers, February 2017
auchenberg
11
2.7k
DevTools of The Future, JSCONF Asia 2016, Singapore
auchenberg
3
290
Future of DevTools, Full Stack Tech 2016, Argentina
auchenberg
0
180
JSCONF Columbia 2016: DevTools for the Progressive Web
auchenberg
1
360
JSCONF China 2016: DevTools for the Progressive Web
auchenberg
2
460
Edge DevTools Summer 2016
auchenberg
0
180
Web Rebels 16: DevTools for the Progressive Web
auchenberg
1
260
AtTheFrontend 16: DevTools for the Progressive Web
auchenberg
1
320
Other Decks in Programming
See All in Programming
Ça bouge du côté des animations CSS !
goetter
2
160
⚪⚪の⚪⚪をSwiftUIで再現す る
u503
0
130
Learning Kotlin with detekt
inouehi
1
210
ML.NETで始める機械学習
ymd65536
0
250
自力でTTSモデルを作った話
zgock999
0
120
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
320
楽しく向き合う例外対応
okutsu
0
740
Webフレームワークとともに利用するWeb components / JSConf.jp おかわり
spring_raining
1
140
Serverless Rust: Your Low-Risk Entry Point to Rust in Production (and the benefits are huge)
lmammino
1
170
[JAWS DAYS 2025] 最近の DB の競合解決の仕組みが分かった気になってみた
maroon1st
0
180
Lambdaの監視、できてますか?Datadogを用いてLambdaを見守ろう
nealle
2
800
仕様変更に耐えるための"今の"DRY原則を考える
mkmk884
9
3.3k
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Typedesign – Prime Four
hannesfritz
41
2.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
How STYLIGHT went responsive
nonsquared
99
5.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
4 Signs Your Business is Dying
shpigford
183
22k
Transcript
Measuring Performance of AngularJS apps San Francisco, December 2015 Kenneth
@auchenberg
Soo, performance?
Page load
Steve Souders
None
YSlow
PageSpeed
We build API’s to help us
Navigation Timing API https://blogs.windows.com/buildingapps/2011/08/02/measuring-mobile-site-performance-using-the-w3c-navigation-timing-api/
Resource Timing API http://www.stevesouders.com/blog/2014/11/25/serious-confusion-with-resource-timing/
Server Initial payload Browser Server-side web apps
The web has changed
Application runtime
None
Server/CDN Initial payload Browser Client-side web apps API App Page
load App boot
Client-side frameworks
Application performance Browser
Application performance
Chrome DevTools: Timeline
Chrome DevTools: CPU Profiler
Where is “my app” timeline?
None
for AngularJS
Framework specific
Trace levels App framework Browser primitives App Template Caching Storage
HTTP XHR/WebSocket MutationObservers LocalStorage Reflow Paint Rasterize Compose viewport engine
Error logging + Performance
Installation
Error logging window.onError + “magic”
Error logging 1. Error parsing 2. Stack frame generation 3.
Stack frame normalization
Code instrumentation Performance
None
Challenges
What is “app load”? (Pageload)
What is “app ready”? (DOMcontentReady)
What is “view changed”? (onhashchange)
AngularJS Page cyclus Bootstrap Router $routeChangeStart $stateChangeSuccess Controller Services $viewContentLoaded
Directives View UI Router ng-route (ngView)
What to instrument? AngularJS $resource $http $templateRequest $httpBackend $compile $module
$service $controller $cacheFactory $templateCache $directives ngBind, ngClass, ngMode, ngIf, ngInclude, ngRepeat, ngSrc, ngStyle, ngSwitch, ngTransclude
$decorate to instrument
Bootstrap module.config $decorate $rootScope $viewContentLoaded Router Route controller $stateChangeSuccess $routeChangeStart
Start transaction Instrument TraceBuffer ngOpbeat TransactionStore ngView $viewContentLoaded End transaction $routeChangeStart opbeatFunctionWrapper new Trace() Transport scheduler Processing Instrumentation flow
<DEMO>
Our breakdown
Behind the scenes
None
AngularJS $injection system …
$injection toString() madness
Replicate function arguments
Resolve loaded modules
V8 + Arguments
V8 + Arguments optimized Source: https://github.com/GoogleChrome/devtools-docs/issues/53#issuecomment-51941358 Explanation: http://stackoverflow.com/questions/29198195/whats-the-deal-with-optimising-arguments
Error stack frame normalization Firefox Chrome
SpiderMonkey naming convention Source: https://developer.mozilla.org/en-US/docs/Tools/Debugger-API/Debugger.Object#Accessor_Properties_of_the_Debugger.Object_prototype
Error stack frame normalization Normalized
opbeat.com/angularjs
github.com/opbeat/opbeat-js Open Source
None
Thanks