{"id":3804,"date":"2022-02-17T10:11:03","date_gmt":"2022-02-17T10:11:03","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/ways-to-increase-your-rails-performance\/"},"modified":"2024-07-04T21:01:27","modified_gmt":"2024-07-04T21:01:27","slug":"ways-to-increase-your-rails-performance","status":"publish","type":"post","link":"https:\/\/thecodest.co\/en\/blog\/ways-to-increase-your-rails-performance\/","title":{"rendered":"How to Increase Rails Performance"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Ruby First<\/strong><\/h2>\n\n\n\n<p><strong><a href=\"https:\/\/thecodest.co\/en\/case-studies\/providing-a-team-of-ruby-developers-for-a-fintech-company\/\">Ruby<\/a><\/strong> is a heavily object-oriented language. In fact, (almost) everything in <strong>Ruby<\/strong> is an object. Creating unnecessary objects might cost your program a lot of additional memory usage, so you need to avoid it.<\/p>\n\n\n\n<p>To measure the difference, we will use a <em><a href=\"https:\/\/github.com\/SamSaffron\/memory_profiler\">memory_profiler<\/a><\/em> gem and a built-in Benchmark module to measure time performance.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Use bang! methods on strings<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">require \"memory_profiler\"\n\nreport = MemoryProfiler.report do\n<a href=\"https:\/\/thecodest.co\/en\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a> = \"X\" * 1024 * 1024 * 100\ndata = data.downcase\nend\n\nreport.pretty_print<\/code><\/pre>\n\n\n\n<p>In the listing below, we created a 100MB string and downcased each character contained therein. Our benchmark gives <a href=\"https:\/\/thecodest.co\/en\/blog\/why-us-companies-are-opting-for-polish-developers\/\">us<\/a> the following report:<\/p>\n\n\n\n<p><em>Total allocated: 210765044 bytes (6 objects)<\/em><\/p>\n\n\n\n<p>However, if we replace line 6 with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code>data.downcase!<\/code><\/code><\/pre>\n\n\n\n<p><code> <\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Read files line by line<\/strong><\/h2>\n\n\n\n<p>Supposedly, we need to fetch a huge data collection of 2 million records from a csv file. Typically, it would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">require 'benchmark'\n\nBenchmark.bm do |x|\nx.report do\nFile.readlines(\"2mrecords.csv\").map! {|line| line.split(\",\")}\nend\nend<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">user \u00a0 \u00a0 system\u00a0 \u00a0 \u00a0 total\u00a0 \u00a0 \u00a0 \u00a0 real\n\n12.797000 \u00a0 2.437000\u00a0 15.234000 (106.319865)<\/code><\/pre>\n\n\n\n<p>It took us more than 106 seconds to fully download the file. Quite a lot! But we can speed up this process by replacing the <em>map!<\/em> method with a simple <em>while<\/em> loop:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">require 'benchmark'\n\nBenchmark.bm do |x|\nx.report do\nfile = File.open(\"2mrecords.csv\", \"r\")\nwhile line = file.gets\nline.split(\",\")\nend\nend\nend<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">user \u00a0 \u00a0 system\u00a0 \u00a0 \u00a0 total\u00a0 \u00a0 \u00a0 \u00a0 real\n\n6.078000 \u00a0 0.250000 \u00a0 6.328000 (\u00a0 6.649422)<\/code><\/pre>\n\n\n\n<p>The runtime has now dropped drastically since the <em>map!<\/em> method belongs to a specific class, like <em>Hash#map<\/em> or <em>Array#map<\/em>, where <strong>Ruby<\/strong> will store every line of the parsed file within the memory as long as it is executed. <strong>Ruby\u2019s garbage collector <\/strong>will not release the memory before those iterators are fully executed. However, reading it line by line will GC it to relocate the memory from the previous lines when not necessary.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Avoid method iterators on larger collections<\/strong><\/h2>\n\n\n\n<p>This one is an extension of the previous point with a more common example. As I mentioned, <a href=\"https:\/\/thecodest.co\/blog\/high-demand-for-ruby-developers\/\">Ruby<\/a> iterators are object methods and they won\u2019t release the memory as long as they\u2019re being performed. On a small-scale, the difference is meaningless (and methods such as <em>map<\/em> seems more readable). However, when it comes to larger data sets, it is always a good idea to consider replacing it with more basic loops. Like on the example below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">numberofelements = 10000000\nrandoms = Array.new(numberofelements) { rand(10) }\n\nrandoms.each do |line|\n#do something\nend<\/code><\/pre>\n\n\n\n<p>and after refactoring:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">numberofelements = 10000000\nrandoms = Array.new(numberofelements) { rand(10) }\n\nwhile randoms.count > 0\nline = randoms.shift\n#do something\nend\n\u201c`<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Use String::&lt;&lt; method<\/strong><\/h2>\n\n\n\n<p>This is a quick yet particularly useful tip. If you append one string to another using the += operator behind the scenes. <strong>Ruby <\/strong> will create additional object. So, this:\u00a0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code> a = \"X\"\n b = \"Y\"\n a += b<\/code><\/code><\/pre>\n\n\n\n<p>Actually means this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code> a = \"X\"\n b = \"Y\"\n c = a + b\n a = c<\/code><\/code><\/pre>\n\n\n\n<p>Operator would avoid that, saving you some memory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code><code> a = \"X\"\n b = \"Y\"\n a &lt;&lt; b<\/code><\/code><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Let&#8217;s talk Rails<\/strong><\/h2>\n\n\n\n<p>The <strong>Rails framework <\/strong> possesses plenty of \u201c<em>gotchas<\/em>\u201d that would allow you to optimize your <a href=\"https:\/\/thecodest.co\/en\/dictionary\/what-is-code-refactoring\/\">code<\/a> quickly and without too much additional effort.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Eager Loading AKA n+1 query problem<\/strong><\/h2>\n\n\n\n<p>Let\u2019s assume that we have two associated models, Post and Author:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Author &lt; ApplicationRecord\nhas_many :posts\nend\n\nclass Post &lt; ApplicationRecord\nbelongs_to :author\nend<\/code><\/pre>\n\n\n\n<p>We want to fetch all the posts in our controller and render them in a view with their authors:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">controller\n\ndef index\n@posts = Post.all.limit(20)\nend\n\nview\n\n&lt;% @posts.each do |post| %>\n&lt;%= post %>\n&lt;%= post.author.name %>\n&lt;% end %><\/code><\/pre>\n\n\n\n<p>In the controller, <a href=\"https:\/\/thecodest.co\/blog\/a-simple-ruby-application-from-scratch-with-active-record\/\">ActiveRecord<\/a> will create only one query to find our posts. But later on, it will also trigger another 20 queries to find each author accordingly \u2013 taking up an additional time! Luckily enough, Rails comes with a quick solution to combine those queries into a single one. By using the <em>includes<\/em> method, we can rewrite our controller this way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code> def index\n     @posts = Post.all.includes(:author).limit(20)\n end<\/code><\/code><\/pre>\n\n\n\n<p>For now, only the necessary data will be fetched into one query.\u00a0<\/p>\n\n\n\n<p>You can also use other gems, such as <a href=\"https:\/\/github.com\/flyerhzm\/bullet\">bullet<\/a> to customize the whole process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Call only what you need<\/strong><\/h2>\n\n\n\n<p>Another useful technique to increase ActiveRecord speed is calling only those attributes which are necessary for your current purposes. This is especially useful when your app starts to grow and the number of columns per table increase as well.<\/p>\n\n\n\n<p>Let\u2019s take our previous code as an example and assume that we only need to select names from authors. So, we can rewrite our controller:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code><code> def index\n     @posts = Post.all.includes(:author).select(\"name\").limit(20)\n end<\/code><\/code><\/code><\/pre>\n\n\n\n<p>Now we instruct our controller to skip all attributes except the one we need.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Render Partials Properly<\/strong><\/h2>\n\n\n\n<p>Let\u2019s say we want to create a separate partial for our posts from previous examples:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code><code><code> &lt;%\n  @posts.each do |post| %>\n  &lt;%= render 'post', post: post %>\n &lt;% end %>\n<\/code><\/code><\/code><\/code><\/pre>\n\n\n\n<p>At first glance, this code looks correct. However, with a larger number of posts to render, the whole process will be significantly slower. This is because <strong>Rails <\/strong> invokes our partial with a new iteration once again. We can fix it by using the <em>collections<\/em> feature:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code><code><code> &lt;%= render @posts %><\/code><\/code><\/code><\/code><\/pre>\n\n\n\n<p>Now, <strong>Rails<\/strong> will automatically figure out which template should be used and initialize it only once.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Use background processing<\/strong><\/h2>\n\n\n\n<p>Every process which is more time-consuming and not crucial for your current flow might be considered a good candidate for background processing, e.g. sending emails, gathering statistics or providing periodical reports.&nbsp;<\/p>\n\n\n\n<p><strong>Sidekiq<\/strong> is the most commonly used gem for background processing. It uses <strong>Redis<\/strong> to store tasks. It also allows you to control the flow of your background process, split them into separate queues and manage memory usage per each one of them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Write less code, use more gems<\/strong><\/h2>\n\n\n\n<p><strong>Rails <\/strong> came up with an enormous number of gems which not only make your life easier and accelerate the <a href=\"https:\/\/thecodest.co\/en\/blog\/how-the-codests-team-extension-model-can-transform-your-in-house-development-team\/\">development process<\/a>, but also increase the performance speed of your application. Gems such as Devise or Pundit are usually well-tested regarding their speed and work faster and more securely than code custom-written for the same purpose.<\/p>\n\n\n\n<p>In case of any questions to improving <em>Rails performance<\/em>, reach <strong><a href=\"https:\/\/thecodest.co\">The Codest engineers<\/a><\/strong> out to consult your doubts.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/thecodest.co\/careers#offers]\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/ruby-1-.png\" alt=\"Ruby Developer Offer\"\/><\/a><\/figure>\n\n\n\n<p><strong>Read more:<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/pros-and-cons-of-ruby-software-development\/\">Pros and cons of Ruby software development<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/rails-and-other-means-of-transport\">Rails and Other Means of Transport<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/rails-development-with-tmux-vim-fzf-ripgrep\">Rails Development with TMUX, Vim, Fzf + Ripgrep<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Despite its numerous advantages, Ruby on Rails is still considered to be a relatively slow web framework. We all know that Twitter has left Rails in favor of Scala. However, with a few cleaver improvements you can run your app significantly faster!<\/p>\n","protected":false},"author":2,"featured_media":3805,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3804","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Increase Rails Performance - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/en\/blog\/ways-to-increase-your-rails-performance\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Increase Rails Performance - The Codest\" \/>\n<meta property=\"og:description\" content=\"Despite its numerous advantages, Ruby on Rails is still considered to be a relatively slow web framework. We all know that Twitter has left Rails in favor of Scala. However, with a few cleaver improvements you can run your app significantly faster!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/en\/blog\/ways-to-increase-your-rails-performance\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-17T10:11:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-04T21:01:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ways_to_increase_your_rails_performance.png\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"How to Increase Rails Performance\",\"datePublished\":\"2022-02-17T10:11:03+00:00\",\"dateModified\":\"2024-07-04T21:01:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/\"},\"wordCount\":856,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ways_to_increase_your_rails_performance.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/\",\"name\":\"How to Increase Rails Performance - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ways_to_increase_your_rails_performance.png\",\"datePublished\":\"2022-02-17T10:11:03+00:00\",\"dateModified\":\"2024-07-04T21:01:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ways_to_increase_your_rails_performance.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ways_to_increase_your_rails_performance.png\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Increase Rails Performance\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/en\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Increase Rails Performance - The Codest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/en\/blog\/ways-to-increase-your-rails-performance\/","og_locale":"en_US","og_type":"article","og_title":"How to Increase Rails Performance - The Codest","og_description":"Despite its numerous advantages, Ruby on Rails is still considered to be a relatively slow web framework. We all know that Twitter has left Rails in favor of Scala. However, with a few cleaver improvements you can run your app significantly faster!","og_url":"https:\/\/thecodest.co\/en\/blog\/ways-to-increase-your-rails-performance\/","og_site_name":"The Codest","article_published_time":"2022-02-17T10:11:03+00:00","article_modified_time":"2024-07-04T21:01:27+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ways_to_increase_your_rails_performance.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"How to Increase Rails Performance","datePublished":"2022-02-17T10:11:03+00:00","dateModified":"2024-07-04T21:01:27+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/"},"wordCount":856,"commentCount":0,"image":{"@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ways_to_increase_your_rails_performance.png","articleSection":["Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/","url":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/","name":"How to Increase Rails Performance - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ways_to_increase_your_rails_performance.png","datePublished":"2022-02-17T10:11:03+00:00","dateModified":"2024-07-04T21:01:27+00:00","author":{"@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ways_to_increase_your_rails_performance.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ways_to_increase_your_rails_performance.png","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"How to Increase Rails Performance"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/en\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts\/3804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/comments?post=3804"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts\/3804\/revisions"}],"predecessor-version":[{"id":8428,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts\/3804\/revisions\/8428"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/media\/3805"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/media?parent=3804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/categories?post=3804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/tags?post=3804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}