Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
@erickwendel_
10 secrets to improve
Javascript
Performance
ERICKWENDEL

LEADSOFTWAREARCHITECTANDTRAINER
@ERICKWENDEL_
@erickwendel_
Backenders ?
@erickwendel_
Experience
With Node.js?
@erickwendel_
Who has worked with Node
since ES5?
@erickwendel_
Why should we care
about application lifecycle?
@erickwendel_
Some errors could crash your
app and turn it off
@erickwendel_
Small changes would fix
big problems
#10 - Understand the Javascript
workflow
@erickwendel_
What is the hardest behaviour on
the Javascript language?
Synchronise operations
@erickwendel_
How to?
@erickwendel_
Do you really need to
wait for an execution?
#9 - Write effective Loops
@erickwendel_
Is Javascript a
functional language?
Inspects all collection
#8 - Cache as much as possible
@erickwendel_
User Experience is important!
▪ How often would the data change?
#JSFEST
▪ How many requests do you plan to support?
▪ How much would it cost?
▪ Where i...
https://medium.com/@MatthewFTech/spring-boot-cache-with-redis-56026f7da83a
https://developer.mozilla.org/en-US/docs/Web/API/Cache
#7 - Use PM2 instead Node
#6 - Implement SSL/TLS and HTTP/2
▪ Multiplexing
#JSFEST
▪ Header Compression
▪ Server Push
▪ Binary Format
BENEFITS
https://www.medianova.com/en-blog/2016/09/29/50-faster-websites-with-http2
#5 - Optimise your response
@erickwendel_
Understand your external
dependencies and inspect them
@erickwendel_
Create indexes for known queries
@erickwendel_
Define boundaries for accessing
your APIs
@erickwendel_
GraphQL x Restfull APIs
GraphQL Request Simple HTTP Request
myapi.com/heroes?
id=123&name=batman&
skip=0&limit=10&
fields=id,name,power
#4 - Inspect performance issues
@erickwendel_
How do I know if
I have a performance issue?
@erickwendel_
Tooling
https://clinicjs.org/doctor/
https://nodejs.org/api/perf_hooks.html
#3 - Use Realtime App Monitoring to analyse your app
@erickwendel_
Observability is
much more than logs
#2 - Use Node.js Streams
@erickwendel_
Readable streams vs fs.readfile
Example redable file
#1 - Learn about Node.js native modules
@erickwendel_
What Node can’t do
it delegates to someone else
@erickwendel_
We can create our own module to
extend v8 behaviour
Questions?
Conclusions
@erickwendel_
Most performance problems are
human errors
@erickwendel_
Be always aware about
what your app is responsible for
@erickwendel_
Keep Javascript
packages up-to-date
@erickwendel_
Learn Javascript <3
erickwendel.com
ERICKWENDEL

INDEPENDENTSOFTWARECONSULTANT
@ERICKWENDEL_|@ERICKWENDEL
СПАСИБІ!
@erickwendel_
• https://erickwendel.com/
• contato@erickwendel.com.br
• https://medium.com/@erickwendel
• http://fb.com/page.erickwendel...
https://dzone.com/
articles/5-tips-to-increase-
nodejs-application-
performance
https://www.nginx.com/
blog/10-tips-for-10...
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
Upcoming SlideShare
Loading in …5
×

of

JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 1 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 2 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 3 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 4 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 5 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 6 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 7 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 8 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 9 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 10 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 11 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 12 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 13 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 14 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 15 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 16 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 17 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 18 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 19 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 20 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 21 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 22 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 23 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 24 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 25 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 26 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 27 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 28 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 29 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 30 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 31 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 32 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 33 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 34 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 35 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 36 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 37 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 38 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 39 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 40 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 41 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 42 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 43 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 44 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 45 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 46 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 47 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 48 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 49 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 50 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 51 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 52 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 53 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 54 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 55 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 56 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 57 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 58 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 59 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 60 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 61 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 62 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 63 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 64 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 65 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 66 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 67 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 68 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 69 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 70 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 71 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 72 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 73 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 74 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 75 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 76 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 77 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 78 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 79 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 80 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 81 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 82 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 83 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 84 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 85 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 86 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 87 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 88 JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance Slide 89
Upcoming SlideShare
What to Upload to SlideShare
Next

2 Likes

Share

JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance

In this talk, attendees will see examples to improve their Javascript Performance making a few changes in their existent application. We will talk about Cache, Node.js common flow, and best practices. They'll see how to avoid performance problems working in Javascript loops, tips to work with Web APIs and best practices javascript applications.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance

  1. 1. @erickwendel_ 10 secrets to improve Javascript Performance ERICKWENDEL
 LEADSOFTWAREARCHITECTANDTRAINER @ERICKWENDEL_
  2. 2. @erickwendel_ Backenders ?
  3. 3. @erickwendel_ Experience With Node.js?
  4. 4. @erickwendel_ Who has worked with Node since ES5?
  5. 5. @erickwendel_ Why should we care about application lifecycle?
  6. 6. @erickwendel_ Some errors could crash your app and turn it off
  7. 7. @erickwendel_ Small changes would fix big problems
  8. 8. #10 - Understand the Javascript workflow
  9. 9. @erickwendel_ What is the hardest behaviour on the Javascript language?
  10. 10. Synchronise operations
  11. 11. @erickwendel_ How to?
  12. 12. @erickwendel_ Do you really need to wait for an execution?
  13. 13. #9 - Write effective Loops
  14. 14. @erickwendel_ Is Javascript a functional language?
  15. 15. Inspects all collection
  16. 16. #8 - Cache as much as possible
  17. 17. @erickwendel_ User Experience is important!
  18. 18. ▪ How often would the data change? #JSFEST ▪ How many requests do you plan to support? ▪ How much would it cost? ▪ Where is the bottleneck? CACHING NEEDS FAQ
  19. 19. https://medium.com/@MatthewFTech/spring-boot-cache-with-redis-56026f7da83a
  20. 20. https://developer.mozilla.org/en-US/docs/Web/API/Cache
  21. 21. #7 - Use PM2 instead Node
  22. 22. #6 - Implement SSL/TLS and HTTP/2
  23. 23. ▪ Multiplexing #JSFEST ▪ Header Compression ▪ Server Push ▪ Binary Format BENEFITS
  24. 24. https://www.medianova.com/en-blog/2016/09/29/50-faster-websites-with-http2
  25. 25. #5 - Optimise your response
  26. 26. @erickwendel_ Understand your external dependencies and inspect them
  27. 27. @erickwendel_ Create indexes for known queries
  28. 28. @erickwendel_ Define boundaries for accessing your APIs
  29. 29. @erickwendel_ GraphQL x Restfull APIs
  30. 30. GraphQL Request Simple HTTP Request myapi.com/heroes? id=123&name=batman& skip=0&limit=10& fields=id,name,power
  31. 31. #4 - Inspect performance issues
  32. 32. @erickwendel_ How do I know if I have a performance issue?
  33. 33. @erickwendel_ Tooling
  34. 34. https://clinicjs.org/doctor/
  35. 35. https://nodejs.org/api/perf_hooks.html
  36. 36. #3 - Use Realtime App Monitoring to analyse your app
  37. 37. @erickwendel_ Observability is much more than logs
  38. 38. #2 - Use Node.js Streams
  39. 39. @erickwendel_ Readable streams vs fs.readfile
  40. 40. Example redable file
  41. 41. #1 - Learn about Node.js native modules
  42. 42. @erickwendel_ What Node can’t do it delegates to someone else
  43. 43. @erickwendel_ We can create our own module to extend v8 behaviour
  44. 44. Questions?
  45. 45. Conclusions
  46. 46. @erickwendel_ Most performance problems are human errors
  47. 47. @erickwendel_ Be always aware about what your app is responsible for
  48. 48. @erickwendel_ Keep Javascript packages up-to-date
  49. 49. @erickwendel_ Learn Javascript <3
  50. 50. erickwendel.com
  51. 51. ERICKWENDEL
 INDEPENDENTSOFTWARECONSULTANT @ERICKWENDEL_|@ERICKWENDEL СПАСИБІ! @erickwendel_
  52. 52. • https://erickwendel.com/ • contato@erickwendel.com.br • https://medium.com/@erickwendel • http://fb.com/page.erickwendel • https://twitter.com/erickwendel_ • http://meetup.com/nerdzao • http://meetup.com/nodebr • https://github.com/ErickWendel/10- tips-js-perf-jsfest-ukraine • http://bit.ly/10-tips-jsperf-jsfestua KEEP IN TOUCH! @erickwendel_
  53. 53. https://dzone.com/ articles/5-tips-to-increase- nodejs-application- performance https://www.nginx.com/ blog/10-tips-for-10x- application-performance/ https://expressjs.com/en/ advanced/best-practice- performance.html https:// www.slideshare.net/ CodeFireTech/web- application-performance https://www.infoq.com/ articles/node-micro- optimizations-javascript https://blog.ghaiklor.com/ profiling-nodejs- applications-1609b77afe4 e https://stackoverflow.com/ questions/41986066/ performance-and- reliability-when-using- multiple-docker-containers- vs-standard-no https://dzone.com/ articles/nine-tips-to- improve-wordpress- performance-with-ng? fromrel=true https://stackoverflow.com/ questions/9420014/what- does-it-mean-scalability https://pt.wikipedia.org/ wiki/Escalabilidade https://pt.slideshare.net/ ratankadam/scalability- using-nodejs https://botleg.com/stories/ auto-scaling-with-docker/ http://ivanjov.com/ running-express-koa-and- hapi-on-http-2/ http:// anandmanisankar.com/ posts/docker-container- nginx-node-redis- example/ https://hapijs.com/ tutorials/caching https://www.ibm.com/ support/knowledgecenter/ en/SS4PJT_5.2.0/ com.ibm.help.cd52.unix.doc / com.ibm.help.cdunix_secplu s.doc/ CDU_Benefits_of_TLS.html http:// brycebaril.github.io/glitch- perf-talk/ https://medium.com/ skyshidigital/6-tricks-to- speed-up-and-improve- your-node-js-performance- fadc06d15cbe https:// www.nearform.com/blog/ tuning-node-js-app- performance-with- autocannon-and-0x/ https://www.youtube.com/ watch?v=gltzZjKYK1I https://nodejs.org/uk/ docs/guides/dont-block- the-event-loop/ https:// www.smashingmagazine.co m/2018/06/nodejs-tools- techniques-performance- servers/ https://snyk.io/blog/ nodejs-how-even-quick- async-functions-can-block- the-event-loop-starve-io/ (IMPORTANT) https://itnext.io/streams- for-the-win-a- performance-comparison- of-nodejs-methods-for- reading-large-datasets- pt-2-bcfa732fa40e (IMPORTANT) https://zaiste.net/ nodejs_10_asynchronous_it eration_async_generators/ (IMPORTANT) https://v8.dev/blog/fast- async https://stackoverflow.com/ questions/86513/why-is- using-the-javascript-eval- function-a-bad-idea https://thoughts.t37.net/ how-we-reindexed-36- billions-documents-in-5- days-within-the-same- elasticsearch-cluster- cd9c054d1db8 https://www.youtube.com/ watch?v=EGMacfyuA9w (new relic) https://scotch.io/tutorials/ how-to-optimize-node- requests-with-simple- caching-strategies https:// www.medianova.com/en- blog/2016/09/29/50- faster-websites-with-http2 https://www.youtube.com/ watch?v=7uNGKCao8gA https://w3c.github.io/ ServiceWorker/#cache https://nodejs.org/api/ perf_hooks.html#perf_hoo ks_examples https://techsparx.com/ nodejs/howto/csv- transformation.html https://medium.com/ @atulanand94/beginners- guide-to-writing-nodejs- addons-using-c-and-n-api- node-addon- api-9b3b718a9a7f https:// www.smashingmagazine.co m/2017/04/guide-http2- server-push/ @erickwendel_
  • KhanhNey

    Apr. 4, 2021
  • AndrewKontsidaylo

    May. 31, 2020

In this talk, attendees will see examples to improve their Javascript Performance making a few changes in their existent application. We will talk about Cache, Node.js common flow, and best practices. They'll see how to avoid performance problems working in Javascript loops, tips to work with Web APIs and best practices javascript applications.

Views

Total views

336

On Slideshare

0

From embeds

0

Number of embeds

0

Actions

Downloads

0

Shares

0

Comments

0

Likes

2

×