This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'activerecord' | |
gem 'benchmark-ips' | |
end | |
require 'benchmark/ips' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'lmdb' | |
require 'benchmark/ips' | |
PATH = __FILE__ | |
MAX_SIZE = 134217728 # 128 MB | |
FileUtils.mkdir_p('/tmp/lmdb-bench') | |
@env = ::LMDB.new('/tmp/lmdb-bench', mapsize: MAX_SIZE, nometasync: true, nosync: true) | |
@database = @env.database('bootsnap', create: true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'zlib' | |
require 'benchmark' | |
require 'rubygems/package' | |
require 'rubygems/package/tar_reader' | |
duration = Benchmark.realtime do | |
tar = Gem::Package::TarReader.new(Zlib::GzipReader.open(ARGV.first)) | |
tar.each { |_| } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: mysql2 | |
username: root | |
host: 192.168.64.72 | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
timeout: 5000 | |
default_animals: &default_animals | |
<<: *default | |
migrations_paths: db/animals_migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source 'https://rubygems.org' | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem 'activerecord', github: 'rails/rails' |
NewerOlder