SlideShare a Scribd company logo
How much view could
a view-chuck chuck if
a view-chuck could
chuck view?
Performance of Elm vs Other by Jesse Tomchak
Little about me
Started into Elm about a year ago
Just finished a teaching sabbatical at Woz-u
Lots of JavaScript, interested in system languages
like Rust, and anything else with great tooling
Performance Alert!
The last measurement after something is done
...but the real benefit is that this approach leads to code
that is easier to understand and maintain
NO NO NO
Just one! Your own.
(With a little help from your smart phone)
Blazing Fast HTML
Part 1 - 2014
Part 2 - 2016
Part 3 - ??
Part 1
Who’s the new guy
2 Points ➔ Purity means that the todoList function will always
have the same output given the same input. So if
we know state.tasks is the same, we can skip
todoListentirely.
➔ Immutability makes it cheap to figure out when
things are “the same”. Immutability guarantees
that if two things are referentially equal, they must
be structurally equal.
Part 2
Bit more pragmatic
2 Points ➔ Skip Work
The best way to speed up virtual DOM diffing is to skip
it! So the programmer can say “only diff the view if
the relevant model changed” with lazy,
shouldComponentUpdate, or OnPush respectively.
➔ Align Work
When you are adding and removing child nodes, a
virtual DOM implementation can end up doing tons of
pointless diffing. To avoid this you have Html.Keyed,
key, or trackBy respectively.
Rules.
No Batching
No requestAnimationFrame
So Let’s see it already
Story for illustration purposes only
Take aways
Elm is fast!
Safe in types gets you there.
It’s not a race, but Elm would win
Thank you!
@jstoelm
@jtomchak
elm-slack : jtomchak
JavaScript to Elm

More Related Content

PDF
Pairing with tmux and vim for DevOps Days Austin 2015
PDF
Have No Fear, Gutenberg Is Near
PDF
PDF
Serverless Ops: What do we do when the server goes away?
PDF
The Mysteries Of JavaScript-Fu (@media SF Edition)
PPTX
AWS Security best practices Terraform AWS security
PPTX
All of Javascript
ODP
Mario Fusco - Comparing different concurrency models on the JVM | Codemotion ...
Pairing with tmux and vim for DevOps Days Austin 2015
Have No Fear, Gutenberg Is Near
Serverless Ops: What do we do when the server goes away?
The Mysteries Of JavaScript-Fu (@media SF Edition)
AWS Security best practices Terraform AWS security
All of Javascript
Mario Fusco - Comparing different concurrency models on the JVM | Codemotion ...

Similar to Elm view (20)

PDF
What every C++ programmer should know about modern compilers (w/ comments, AC...
PPTX
Why you shouldnt use django for that
PPTX
All of javascript
PDF
IC3 -- Configuration Management 101
PDF
Infrastructure as code might be literally impossible
PDF
Functional programming is the most extreme programming
PDF
The Holistic Programmer
PDF
Infrastructure as code might be literally impossible / Joe Domato (packageclo...
PDF
10 things you're doing wrong in Talend
PDF
10 things you're doing wrong in Talend
PDF
Konstantin Knizhnik: static analysis, a view from aside
PDF
Comparing different concurrency models on the JVM
PDF
Application architecture
PDF
JavaScript Best Pratices
PDF
Culture And Aesthetic Revisited
PPTX
Rethinking Best Practices
PDF
Learning to code in 2020
PDF
React Conf 17 Recap
PDF
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
PPT
What does OOP stand for?
What every C++ programmer should know about modern compilers (w/ comments, AC...
Why you shouldnt use django for that
All of javascript
IC3 -- Configuration Management 101
Infrastructure as code might be literally impossible
Functional programming is the most extreme programming
The Holistic Programmer
Infrastructure as code might be literally impossible / Joe Domato (packageclo...
10 things you're doing wrong in Talend
10 things you're doing wrong in Talend
Konstantin Knizhnik: static analysis, a view from aside
Comparing different concurrency models on the JVM
Application architecture
JavaScript Best Pratices
Culture And Aesthetic Revisited
Rethinking Best Practices
Learning to code in 2020
React Conf 17 Recap
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
What does OOP stand for?
Ad

Recently uploaded (20)

PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
A Presentation on Artificial Intelligence
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
A Presentation on Touch Screen Technology
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
project resource management chapter-09.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Enhancing emotion recognition model for a student engagement use case through...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A Presentation on Artificial Intelligence
Chapter 5: Probability Theory and Statistics
A comparative analysis of optical character recognition models for extracting...
A novel scalable deep ensemble learning framework for big data classification...
Digital-Transformation-Roadmap-for-Companies.pptx
DP Operators-handbook-extract for the Mautical Institute
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
A Presentation on Touch Screen Technology
Assigned Numbers - 2025 - Bluetooth® Document
1 - Historical Antecedents, Social Consideration.pdf
OMC Textile Division Presentation 2021.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
project resource management chapter-09.pdf
Tartificialntelligence_presentation.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Ad

Elm view

  • 1. How much view could a view-chuck chuck if a view-chuck could chuck view? Performance of Elm vs Other by Jesse Tomchak
  • 2. Little about me Started into Elm about a year ago Just finished a teaching sabbatical at Woz-u Lots of JavaScript, interested in system languages like Rust, and anything else with great tooling
  • 3. Performance Alert! The last measurement after something is done ...but the real benefit is that this approach leads to code that is easier to understand and maintain NO NO NO
  • 4. Just one! Your own. (With a little help from your smart phone)
  • 5. Blazing Fast HTML Part 1 - 2014 Part 2 - 2016 Part 3 - ??
  • 7. 2 Points ➔ Purity means that the todoList function will always have the same output given the same input. So if we know state.tasks is the same, we can skip todoListentirely. ➔ Immutability makes it cheap to figure out when things are “the same”. Immutability guarantees that if two things are referentially equal, they must be structurally equal.
  • 8. Part 2 Bit more pragmatic
  • 9. 2 Points ➔ Skip Work The best way to speed up virtual DOM diffing is to skip it! So the programmer can say “only diff the view if the relevant model changed” with lazy, shouldComponentUpdate, or OnPush respectively. ➔ Align Work When you are adding and removing child nodes, a virtual DOM implementation can end up doing tons of pointless diffing. To avoid this you have Html.Keyed, key, or trackBy respectively.
  • 11. So Let’s see it already Story for illustration purposes only
  • 12. Take aways Elm is fast! Safe in types gets you there. It’s not a race, but Elm would win
  • 13. Thank you! @jstoelm @jtomchak elm-slack : jtomchak JavaScript to Elm