3. •Javascript templates at LinkedIn
•LinkedIn applications using Dust JS
•Measuring Web-Performance at LinkedIn
•Deep dive : A mile long page
•Lessons learnt and Next steps
Outline
3
Wednesday, June 19, 13
4. •Javascript templates at LinkedIn
•LinkedIn applications using Dust JS
•Measuring Web-Performance at LinkedIn
•Deep dive : A mile long page
•Lessons learnt and Next steps
Outline
4
Wednesday, June 19, 13
5. What is the story of
Dust
at
LinkedIn ?
5
Wednesday, June 19, 13
7. Web - infrastructure
No Sharing UI across pages
Do the same thing over and over
Rapid UI prototyping is hard
No single web-technology
legacy/custom web technologies
LI-JSP
JRuby
Grails
DWR YUI
How to build for mobile?
7
Wednesday, June 19, 13
9. 1. Unify by enabling
the web-applications
to serve JSON
JSON
browser
grails jruby java
9
Wednesday, June 19, 13
10. 2. Build a high-performing
web-proxy layer
to do common things
10
Wednesday, June 19, 13
11. Since browser understands HTML,
we needed {something}
that transformed JSON ==> HTML
JSON + {something}
browser
grails jruby java
HTML
11
Wednesday, June 19, 13
19. •high-performance with modern browsers
•pre-compiled to JS at build-time
•CDN cached with 365d expires
•< 4KB compressed
•logic-less, but extensible with helpers
(function() {
dust.register("demo", body_0);
function body_0(chk, ctx) {
return chk.write("Hello World!");
}
return body_0;
})()
The Good Parts
19
Wednesday, June 19, 13
20. The Good Parts
ops : operations per second
http://linkedin.github.io/dustjs/benchmark/index.html
20
Wednesday, June 19, 13
21. The Good Parts...
The same {dust}template can be
rendered
either on the browser
or on the server
21
Wednesday, June 19, 13
33. •Javascript templates at LinkedIn
•LinkedIn applications using Dust JS
•Measuring Web-Performance at LinkedIn
•Deep dive : A mile long page
•Lessons learnt and Next steps
Outline
33
Wednesday, June 19, 13
51. •Javascript templates at LinkedIn
•LinkedIn applications using Dust JS
•Measuring Web-Performance at LinkedIn
•Deep dive : A mile long page
•Lessons learnt and Next steps
Outline
51
Wednesday, June 19, 13
52. Web-Performance depends on
What we measure ?
52
metrics such as
page on-load, TTFB,
page-size, start-render
Wednesday, June 19, 13
62. •Javascript templates at LinkedIn
•LinkedIn applications using Dust JS
•Measuring Web-Performance at LinkedIn
•Deep dive : A mile long page
•Lessons learnt and Next steps
Outline
62
Wednesday, June 19, 13
64. Symptoms we saw with
Client-side rendering with
traditional metrics
64
Wednesday, June 19, 13
65. Certain
browsers and
geo, on-load
time miserable
• Too many {dust} templates, slow parsing,
blocking
• Slow JSON parsing on the IE browsers
• Sub-optimal Dust JS helpers
65
Wednesday, June 19, 13
66. JSON payload
size high
• Heavy JSON payloads from long key names
and repetitions in the JSON
• Easy to send more data than what the
template needs
66
{
“i18n_text_plain_0_renders_the_connection_count : “Your are connected to 4 users”,
“first” : “Alfred”,
“last” : “Willis”,
“fullName” : “ Alfred Willis”
}
Hello {fullName}
{i18n_text_plain_0_renders_the_connection_count}
Long JSON keys
Wednesday, June 19, 13
67. More
{dust}
means more
http-requests
• Dust supports dynamic, async template
loading, does not scale
• Slow CDN combined with high browser
cache-miss across different geo,
particularly bad in Asia-pacific , India
67
Wednesday, June 19, 13
68. Solution
Optimize for the above the fold
&
Use server-side JS engine for slow
browsers and geo
68
Wednesday, June 19, 13
69. 69
#1 Split the Monolithic page to Embeds
1
2
3
4
5
Wednesday, June 19, 13
74. •Javascript templates at LinkedIn
•LinkedIn applications using Dust JS
•Measuring Web-Performance at LinkedIn
•Deep dive : A mile long page
•Lessons learnt and Next steps
Outline
74
Wednesday, June 19, 13
77. Performance is also User Perception and
Engagement.
How fast can they see anything on the page?
How early can they engage ?
Is the user-experience consistent?
Simplify the design.
Wednesday, June 19, 13
78. Next Steps
78
•Invest more in open-source for improving
performance, dust.js and V8
•Enforce leaner JSON payload size
•Prefetching resources for certain use cases
such as search
•Evolve with the new web-standards
•Move to faster CDNs across geo
•Invest in intelligent ways to co-relate
Wednesday, June 19, 13
79. The Core Team @ LinkedIn
79
Questions!!
http://linkedin.github.io/dustjs/
Meet the team
Office Hours next
@ Exhibit Hall (Table 2)
Veena Basavaraj Eran Leshem Baq Haidri Brian Geffon John Bernado
Wednesday, June 19, 13