{"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":"modi-per-aumentare-le-prestazioni-delle-rotaie","status":"publish","type":"post","link":"https:\/\/thecodest.co\/it\/blog\/ways-to-increase-your-rails-performance\/","title":{"rendered":"Come aumentare le prestazioni di Rails"},"content":{"rendered":"<h2 class=\"wp-block-heading\"><strong>Prima il rubino<\/strong><\/h2>\n\n\n\n<p><strong><a href=\"https:\/\/thecodest.co\/it\/case-studies\/providing-a-team-of-ruby-developers-for-a-fintech-company\/\">Rubino<\/a><\/strong> \u00e8 un linguaggio fortemente orientato agli oggetti. Infatti, (quasi) tutto in <strong>Rubino<\/strong> \u00e8 un oggetto. La creazione di oggetti non necessari potrebbe costare al programma un notevole utilizzo di memoria aggiuntiva, quindi \u00e8 necessario evitarla.<\/p>\n\n\n\n<p>Per misurare la differenza, utilizzeremo un <em><a href=\"https:\/\/github.com\/SamSaffron\/memory_profiler\">profilatore_di_memoria<\/a><\/em> e un modulo Benchmark integrato per misurare le prestazioni del tempo.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Utilizzare i metodi bang! sulle stringhe<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">richiedere \"memory_profiler\"\n\nreport = MemoryProfiler.report do\n<a href=\"https:\/\/thecodest.co\/it\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">dati<\/a> = \"X\" * 1024 * 1024 * 100\ndati = data.downcase\nfine\n\nreport.pretty_print<\/code><\/pre>\n\n\n\n<p>Nell'elenco che segue, abbiamo creato una stringa di 100 MB e abbiamo ridotto ogni carattere in essa contenuto. Il nostro benchmark d\u00e0 <a href=\"https:\/\/thecodest.co\/it\/blog\/why-us-companies-are-opting-for-polish-developers\/\">noi<\/a> la seguente relazione:<\/p>\n\n\n\n<p><em>Totale allocato: 210765044 byte (6 oggetti)<\/em><\/p>\n\n\n\n<p>Tuttavia, se sostituiamo la riga 6 con:<\/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>Leggere i file riga per riga<\/strong><\/h2>\n\n\n\n<p>Si suppone che si debba recuperare un'enorme raccolta di dati di 2 milioni di record da un file csv. In genere, il file si presenta in questo modo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">richiedere 'benchmark'\n\nBenchmark.bm do |x|\nx.report do\nFile.readlines(\"2mrecords.csv\").map! {|linea|linea.split(\",\")}\nfine\nfine<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">utente sistema totale reale\n\n12.797000 2.437000 15.234000 (106.319865)<\/code><\/pre>\n\n\n\n<p>Abbiamo impiegato pi\u00f9 di 106 secondi per scaricare completamente il file. Un bel po'! Ma possiamo accelerare questo processo sostituendo il parametro <em>mappa!<\/em> con un semplice metodo <em>mentre<\/em> ciclo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">richiedere 'benchmark'\n\nBenchmark.bm do |x|\nx.report do\nfile = File.open(\"2mrecords.csv\", \"r\")\nwhile line = file.gets\nline.split(\",\")\nfine\nfine\nfine<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">utente sistema totale reale\n\n6.078000 0.250000 6.328000 ( 6.649422)<\/code><\/pre>\n\n\n\n<p>Il tempo di esecuzione si \u00e8 ridotto drasticamente da quando il <em>mappa!<\/em> appartiene a una classe specifica, come <em>Hash#map<\/em> o <em>Array#map<\/em>, dove <strong>Rubino<\/strong> memorizzer\u00e0 ogni riga del file analizzato all'interno della memoria per tutto il tempo in cui viene eseguito. <strong>Il garbage collector di Ruby <\/strong>non rilascer\u00e0 la memoria prima che gli iteratori siano stati eseguiti completamente. Tuttavia, leggendo riga per riga, GC riposizioner\u00e0 la memoria dalle righe precedenti quando non \u00e8 necessario.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Evitare gli iteratori dei metodi su raccolte pi\u00f9 grandi<\/strong><\/h2>\n\n\n\n<p>Questa \u00e8 un'estensione del punto precedente con un esempio pi\u00f9 comune. Come ho gi\u00e0 detto, <a href=\"https:\/\/thecodest.co\/blog\/high-demand-for-ruby-developers\/\">Rubino<\/a> Gli iteratori sono metodi di oggetti e non rilasciano la memoria finch\u00e9 vengono eseguiti. Su piccola scala, la differenza non \u00e8 significativa (e metodi come <em>mappa<\/em> sembra pi\u00f9 leggibile). Tuttavia, quando si tratta di insiemi di dati pi\u00f9 grandi, \u00e8 sempre una buona idea considerare la possibilit\u00e0 di sostituirli con cicli pi\u00f9 semplici. Come nell'esempio seguente:<\/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 |linea|\n#fare qualcosa\nfine<\/code><\/pre>\n\n\n\n<p>e dopo la rifattorizzazione:<\/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\nmentre randoms.count &gt; 0\nlinea = randoms.shift\n#fare qualcosa\nfine\n\"`<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Utilizzare il metodo String::&lt;&lt;<\/strong><\/h2>\n\n\n\n<p>Si tratta di un suggerimento rapido ma particolarmente utile. Se si aggiunge una stringa a un'altra usando l'operatore += dietro le quinte. <strong>Rubino <\/strong> creer\u00e0 un oggetto aggiuntivo. Quindi, questo:\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>In realt\u00e0 significa questo:<\/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>L'operatore lo eviterebbe, risparmiando un po' di memoria:<\/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>Parliamo di Rails<\/strong><\/h2>\n\n\n\n<p>Il <strong>Struttura Rails <\/strong> possiede un'abbondanza di \"<em>gotchas<\/em>\" che vi permetter\u00e0 di ottimizzare il vostro <a href=\"https:\/\/thecodest.co\/it\/dictionary\/what-is-code-refactoring\/\">codice<\/a> rapidamente e senza troppi sforzi aggiuntivi.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Carico ansioso alias problema delle n+1 query<\/strong><\/h2>\n\n\n\n<p>Supponiamo di avere due modelli associati, Post e Author:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">classe Autore &lt; ApplicationRecord\nhas_many :post\nfine\n\nclasse Post &lt; ApplicationRecord\nappartiene a :author\nfine<\/code><\/pre>\n\n\n\n<p>Vogliamo recuperare tutti i post nel nostro controllore e renderli in una vista con i loro autori:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">controllore\n\ndef indice\n@posts = Post.all.limit(20)\nfine\n\nvista<\/code><\/pre>\n\n\n\n<p>Nel controllore, <a href=\"https:\/\/thecodest.co\/blog\/a-simple-ruby-application-from-scratch-with-active-record\/\">ActiveRecord<\/a> creer\u00e0 una sola query per trovare i nostri post. In seguito, per\u00f2, verranno attivate altre 20 query per trovare ciascun autore, con un ulteriore dispendio di tempo! Fortunatamente, Rails offre una soluzione rapida per combinare queste query in una sola. Utilizzando l'opzione <em>comprende<\/em> possiamo riscrivere il nostro controllore in questo modo:<\/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 fine<\/code><\/code><\/pre>\n\n\n\n<p>Per il momento, solo i dati necessari verranno recuperati in un'unica query.\u00a0<\/p>\n\n\n\n<p>\u00c8 possibile utilizzare anche altre gemme, come ad esempio <a href=\"https:\/\/github.com\/flyerhzm\/bullet\">proiettile<\/a> per personalizzare l'intero processo.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Chiamate solo ci\u00f2 che vi serve<\/strong><\/h2>\n\n\n\n<p>Un'altra tecnica utile per aumentare la velocit\u00e0 di ActiveRecord consiste nel richiamare solo gli attributi necessari per gli scopi attuali. Questo \u00e8 particolarmente utile quando l'applicazione inizia a crescere e aumenta anche il numero di colonne per tabella.<\/p>\n\n\n\n<p>Prendiamo come esempio il codice precedente e supponiamo di dover selezionare solo i nomi dagli autori. Quindi, possiamo riscrivere il nostro controllore:<\/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 fine<\/code><\/code><\/code><\/pre>\n\n\n\n<p>Ora istruiamo il nostro controllore a saltare tutti gli attributi, tranne quello di cui abbiamo bisogno.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Rendering corretto delle parziali<\/strong><\/h2>\n\n\n\n<p>Supponiamo di voler creare un partial separato per i post degli esempi precedenti:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code><code>\n<\/code><\/code><\/code><\/code><\/pre>\n\n\n\n<p>A prima vista, questo codice sembra corretto. Tuttavia, con un numero maggiore di post da rendere, l'intero processo sar\u00e0 significativamente pi\u00f9 lento. Questo perch\u00e9 <strong>Rotaie <\/strong> richiama il nostro partial con una nuova iterazione. Possiamo risolvere il problema utilizzando l'opzione <em>collezioni<\/em> caratteristica:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code><code><\/code><\/code><\/code><\/code><\/pre>\n\n\n\n<p>Ora, <strong>Rotaie<\/strong> capir\u00e0 automaticamente quale modello deve essere usato e lo inizializzer\u00e0 una sola volta.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Utilizzare l'elaborazione in background<\/strong><\/h2>\n\n\n\n<p>Tutti i processi che richiedono pi\u00f9 tempo e non sono cruciali per il vostro flusso attuale possono essere considerati un buon candidato per l'elaborazione in background, ad esempio l'invio di e-mail, la raccolta di statistiche o la fornitura di report periodici.&nbsp;<\/p>\n\n\n\n<p><strong>Sidekiq<\/strong> \u00e8 la gemma pi\u00f9 comunemente usata per l'elaborazione in background. Utilizza <strong>Redis<\/strong> per memorizzare le attivit\u00e0. Permette inoltre di controllare il flusso dei processi in background, di dividerli in code separate e di gestire l'uso della memoria per ognuno di essi.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Scrivere meno codice, usare pi\u00f9 gemme<\/strong><\/h2>\n\n\n\n<p><strong>Rotaie <\/strong> ha proposto un numero enorme di gemme che non solo rendono la vita pi\u00f9 facile e accelerano la <a href=\"https:\/\/thecodest.co\/it\/blog\/how-the-codests-team-extension-model-can-transform-your-in-house-development-team\/\">processo di sviluppo<\/a>ma anche di aumentare la velocit\u00e0 delle prestazioni dell'applicazione. Gemme come Devise o Pundit sono di solito ben collaudate per quanto riguarda la loro velocit\u00e0 e funzionano in modo pi\u00f9 rapido e sicuro rispetto al codice scritto su misura per lo stesso scopo.<\/p>\n\n\n\n<p>In caso di domande per migliorare <em>Prestazioni di Rails<\/em>, raggiungere <strong><a href=\"https:\/\/thecodest.co\">Ingegneri The Codest<\/a><\/strong> per consultare i vostri dubbi.<\/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=\"Offerta per sviluppatori Ruby\"\/><\/a><\/figure>\n\n\n\n<p><strong>Per saperne di pi\u00f9:<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/pros-and-cons-of-ruby-software-development\/\">Pro e contro dello sviluppo software in Ruby<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/rails-and-other-means-of-transport\">Rotaie e altri mezzi di trasporto<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/rails-development-with-tmux-vim-fzf-ripgrep\">Sviluppo di Rails con TMUX, Vim, Fzf + Ripgrep<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Nonostante i suoi numerosi vantaggi, Ruby on Rails \u00e8 ancora considerato un framework web relativamente lento. Sappiamo tutti che Twitter ha abbandonato Rails a favore di Scala. Tuttavia, con alcuni miglioramenti intelligenti \u00e8 possibile eseguire la propria applicazione in modo significativamente pi\u00f9 veloce!<\/p>","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 Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-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\/it\/blog\/modi-per-aumentare-le-prestazioni-delle-rotaie\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Increase Rails Performance\" \/>\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\/it\/blog\/modi-per-aumentare-le-prestazioni-delle-rotaie\/\" \/>\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 minuti\" \/>\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,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"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\":\"it-IT\",\"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\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/ways-to-increase-your-rails-performance\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@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\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"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\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@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\\\/it\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Come aumentare le prestazioni di Rails - 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\/it\/blog\/modi-per-aumentare-le-prestazioni-delle-rotaie\/","og_locale":"it_IT","og_type":"article","og_title":"How to Increase Rails Performance","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\/it\/blog\/modi-per-aumentare-le-prestazioni-delle-rotaie\/","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 minuti"},"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,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"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":"it-IT","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":"Come aumentare le prestazioni di Rails - 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","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/ways-to-increase-your-rails-performance\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@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":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"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":"it-IT"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"it-IT","@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\/it\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/posts\/3804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/comments?post=3804"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/posts\/3804\/revisions"}],"predecessor-version":[{"id":8428,"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/posts\/3804\/revisions\/8428"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/media\/3805"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/media?parent=3804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/categories?post=3804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/it\/wp-json\/wp\/v2\/tags?post=3804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}