Reducing Ruby Memory Overhead with frozen_string_literal
Learn how to use the frozen_string_literal pragma in Ruby to reduce memory allocations and improve GC performance while avoiding FrozenError crashes.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to use the frozen_string_literal pragma in Ruby to reduce memory allocations and improve GC performance while avoiding FrozenError crashes.
Learn how to eliminate full-page reloads in Ruby on Rails using Turbo Frames to create a snappier, SPA-like experience without leaving the server-side ecosystem.
Upon rebuilding my Postgresql database from a dump file using pg_restore , my schema file db/schema.rb is now prefixing the gen_random_uuid() function with public . create_table "cars", id: :uuid, default: -> { "public.gen_random_uuid()" } How can I prevent from the schema file from prefixing method calls with public ?
I'm getting an error message that I can't find the solution for when I'm trying to install Rails v 6.1.1 on my new Mac machine (still on Catalina, not Big Sur) I have rbenv and Homebrew installed and have updated to the latest version of Ruby (3.0.0). When I put out which ruby I get: /usr/local/opt/ruby/bin/ruby Here's the error code I'm seeing in terminal w
I am writing a Github action where I want to use postgres:11 image as a service. But everytime, it tries to start I get error Failed to initialize, db service is unhealthy. Github action looks like: name: CI on: [push] jobs: unit_tests: name: 'Run unit tests' runs-on: ubuntu-latest services: db: image: postgres:11 ports: ['5432:5432'] options: >- --health
I recently deleted my local project but did a git clone and picked up from where I last committed. As I tried to upload images to AWS, which was already configured, I got this error: Aws::Sigv4::Errors::MissingCredentialsError in RentalsController#create Cannot load `Rails.config.active_storage.service`: missing credentials, provide credentials with one of t
Updated app Rails 5.2 to 6, the following two migrations were added by the update: # This migration comes from active_storage (originally 20190112182829) class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] def up unless column_exists?(:active_storage_blobs, :service_name) add_column :active_storage_blobs, :service_name, :string if conf
To minimize infrastructure costs for low-traffic workloads, Ruby on Rails applications often utilize a single-process, multi-threaded Puma configuration. This approach aims to reduce the total RAM footprint by avoiding the overhead of multiple worker processes. However, there is uncertainty regarding the relationship between thread count and memory bloat whe
answered · 28 Oct 2024, 09:00 UTC