Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
60
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
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
190
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.6k
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
1.2k
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
130
チームをチームにするEM
hitode909
0
350
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
510
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
110
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
gunshi
kazupon
1
110
エディターってAIで操作できるんだぜ
kis9a
0
740
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
150
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
130
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
77
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
30
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Cult of Friendly URLs
andyhume
79
6.7k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
2
2.7k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
120
Done Done
chrislema
186
16k
Discover your Explorer Soul
emna__ayadi
2
1k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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