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
All you need is Performance
Search
Sadiksha
April 13, 2016
Programming
1
59
All you need is Performance
This presentation is about how I used small techniques to improve speed of my rails application.
Sadiksha
April 13, 2016
Tweet
Share
More Decks by Sadiksha
See All by Sadiksha
Rails Conf 2016 - Lightening Talk
sadiksha
1
140
Other Decks in Programming
See All in Programming
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
550
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
260
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
3.4k
Ruby Parser progress report 2025
yui_knk
1
460
1から理解するWeb Push
dora1998
7
2k
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
650
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
170
GitHubとGitLabとAWS CodePipelineでCI/CDを組み比べてみた
satoshi256kbyte
4
250
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.6k
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
460
デザイナーが Androidエンジニアに 挑戦してみた
874wokiite
0
570
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
350
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Site-Speed That Sticks
csswizardry
10
830
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
What's in a price? How to price your products and services
michaelherold
246
12k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Being A Developer After 40
akosma
90
590k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Transcript
All you need is Performance Sadiksha Gautam Software Developer @
EnerNOC, Munich www.sadiksha.com @sadikshagautam (twitter)
[email protected]
11/05/16
Performance Issues ¡ Its all about users ¡ Blamed? ¡
Happy? ¡ Temporary or permanent solutions 2
Temporary Solutions [Source: https://memegenerator.net] [Source: http://imgur.com/iWKad22] 3
Permanent Solutions ¡ Use your experience ¡ Avoid premature optimization
¡ Profiling ¡ Optimize server and client side performance 4
Server and Client side ¡ Server side ¡ Upgrade Ruby
¡ Pagination ¡ Optimize database queries ¡ Client side ¡ Turbolinks ¡ Pjax 5
Upgrade Ruby ¡ Rails Request Per Second ¡ Ruby 1.9.3
~ 86 rps ¡ Ruby 2.1.1 ~ 110 rps [Source: http://www.isrubyfastyet.com/] 6
Upgrade Ruby ¡ Rails startup time ¡ Ruby 1.9.3 ~
4.90 seconds ¡ Ruby 2.1.1 ~ 2.35 seconds [Source: http://www.isrubyfastyet.com/] 7
Pagination ¡ Gem: will_paginate ¡ Limited data ¡ My application:
¡ 450 data rows initially ¡ 25 data after pagination ¡ Before: 5355ms ¡ After: 2488ms 8
Profiling ¡ Gem – rack-mini-profiler ¡ Information about database queries
[Source: http://railscasts.com/static/episodes/asciicasts/E368I01.png] 9
Optimize Database Queries ¡ Add indexes – (gem lol_dba) ¡
From 1.35s to 1.08s ¡ Use select and pluck ¡ Only required columns from database tables ¡ Pluck: array of data ¡ Includes and joins ¡ From 14,219 to 11,254 queries 10
Turbolinks ¡ Built in for rails 4 ¡ For rails
3: ¡ gem ‘turbolinks’ ¡ Speeds up application by two times ¡ Does not load all the unchanged assets 11
Pjax ¡ Pjax = pushState + ajax ¡ Jquery plugin
¡ jquery_pjax (gem) ¡ Less automatic 12
Further Improvements ¡ Browser caching ¡ Counter caching ¡ Bullet
gem ¡ Performance testing (gem rails-perftest) 13
Most Important ¡ Fast application ¡ Happy Users ¡ Happy
you ¡ Happy world ¡ Feel proud 14
Lets Discuss 15 [Source: http://i1.wp.com/teachinginkoreanuniversity.com/wp-content/uploads/2015/06/team.jpg]
References ¡ www.railscasts.com ¡ www.pluralsight.com ¡ https://github.com/plentz/lol_dba ¡ https://github.com/MiniProfiler/rack-mini-profiler ¡
https://github.com/SamSaffron/flamegraph ¡ https://github.com/mislav/will_paginate ¡ https://github.com/rails/cache_digests ¡ http://railscasts.com/episodes/387-cachedigests?view=comments ¡ https://github.com/rails/jquery-rails ¡ https://github.com/kossnocorp/jquery.turbolinks ¡ https://github.com/defunkt/jquery-pjax ¡ https://github.com/flyerhzm/bullet 16