SlideShare a Scribd company logo
Performance tips in rails development [email_address]
   
select * temporary table :select belongs_to, has_many
   
text, blob blogs: id, title, content temporary table blogs: id, title, content_id contents: id, content memcached
   
db:migrate t.column "title", :string varchar(255) :limit
   
update @article.update_attributes(params[:article]) @article.update_attributes(:title => "#{params[:article][:title]}", :author => "#{params[:article][:author]}")
   
join :include, :joins mysql> SELECT * FROM tag -> JOIN tag_post ON tag_post.tag_id=tag.id -> JOIN post ON tag_post.post_id=post.id -> WHERE tag.tag='mysql'; mysql> SELECT * FROM tag WHERE tag='mysql'; mysql> SELECT * FROM tag_post WHERE tag_id=1234; mysql> SELECT * FROM post WHERE post.id in (123,456,567,9098,8904); High.Performance.MySQL.Second.Edition, p159
   
IN vs OR SELECT * FROM wp_posts WHERE post_author IN ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) SELECT * FROM wp_posts WHERE post_author = 1 OR post_author = 2 OR post_author = 3 OR post_author = 4 OR post_author = 5 OR post_author = 6 OR post_author = 7 OR post_author = 8 OR post_author = 9 http://www.webmastersbydesign.com/2008/07/13/sql-speed-test-in-vs-or/
   
helpers link_to, url_for
   
session store file db memcached CookieStore, Rails 2.0 http://izumi.plan99.net/blog/index.php/2007/11/25/rails-20-cookie-session-store-and-security/
   
memcached memcache-client cache_fu cache-money, Write-Through http://github.com/nkallen/cache-money/tree/master key
   
Tools newrelic_rpm request-log-analyzer http://github.com/wvanbergen/request-log-analyzer/tree/master rawk http://rubyforge.org/projects/rawk-the-logs/ railsbench http://rubyforge.org/projects/railsbench
THANK YOU :)  

More Related Content

Recently uploaded (20)

PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
July Patch Tuesday
Ivanti
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 

Featured (20)

PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
 
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
 
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
PDF
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
PDF
Everything You Need To Know About ChatGPT
Expeed Software
 
PDF
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
PDF
Skeleton Culture Code
Skeleton Technologies
 
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
PDF
Content Methodology: A Best Practices Report (Webinar)
contently
 
PPTX
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
PDF
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
PDF
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
PDF
Getting into the tech field. what next
Tessa Mero
 
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
PDF
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
PDF
Introduction to Data Science
Christy Abraham Joy
 
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
 
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
 
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Christy Abraham Joy
 
Ad

Performance Tips In Rails Development

  • 1. Performance tips in rails development [email_address]
  • 3. select * temporary table :select belongs_to, has_many
  • 5. text, blob blogs: id, title, content temporary table blogs: id, title, content_id contents: id, content memcached
  • 7. db:migrate t.column "title", :string varchar(255) :limit
  • 9. update @article.update_attributes(params[:article]) @article.update_attributes(:title => "#{params[:article][:title]}", :author => "#{params[:article][:author]}")
  • 10.    
  • 11. join :include, :joins mysql> SELECT * FROM tag -> JOIN tag_post ON tag_post.tag_id=tag.id -> JOIN post ON tag_post.post_id=post.id -> WHERE tag.tag='mysql'; mysql> SELECT * FROM tag WHERE tag='mysql'; mysql> SELECT * FROM tag_post WHERE tag_id=1234; mysql> SELECT * FROM post WHERE post.id in (123,456,567,9098,8904); High.Performance.MySQL.Second.Edition, p159
  • 12.    
  • 13. IN vs OR SELECT * FROM wp_posts WHERE post_author IN ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) SELECT * FROM wp_posts WHERE post_author = 1 OR post_author = 2 OR post_author = 3 OR post_author = 4 OR post_author = 5 OR post_author = 6 OR post_author = 7 OR post_author = 8 OR post_author = 9 http://www.webmastersbydesign.com/2008/07/13/sql-speed-test-in-vs-or/
  • 14.    
  • 16.    
  • 17. session store file db memcached CookieStore, Rails 2.0 http://izumi.plan99.net/blog/index.php/2007/11/25/rails-20-cookie-session-store-and-security/
  • 18.    
  • 19. memcached memcache-client cache_fu cache-money, Write-Through http://github.com/nkallen/cache-money/tree/master key
  • 20.    
  • 21. Tools newrelic_rpm request-log-analyzer http://github.com/wvanbergen/request-log-analyzer/tree/master rawk http://rubyforge.org/projects/rawk-the-logs/ railsbench http://rubyforge.org/projects/railsbench