This file contains 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
Nb of items returned by the query | Ruby (Ruby on Rails) + AR | Ruby (Ruby on Rails) + Sequel | Crystal (Amber) | Ratio: Ruby + AR/Crystal | |
---|---|---|---|---|---|
10 | 17ms | 10ms | 4ms | 4.25x | |
25 | 21ms | 14ms | 10ms | 2.1x | |
50 | 24ms | 18ms | 12ms | 2x | |
100 | 32ms | 25ms | 16ms | 2x | |
200 | 54ms | 36ms | 20ms | 2.7x | |
500 | 114ms | 80ms | 33ms | 3.5x | |
1000 | 188ms | 151ms | 76ms | 2.5x |
This file contains 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
class ProductQuery < Granite::Base | |
connection pg | |
column id : Int64, primary: true | |
column user_id : Int64 | |
column title : String? | |
column description : String? | |
column tags : Array(Int64) | Nil | |
column amount : Float64? | |
column attachment : String? |
This file contains 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 "cache" | |
class ProductController < ApplicationController | |
getter filter_by_tags : Bool? | |
def index | |
# NO TAGS -> CACHE | |
if !filter_by_tags? && !filter_by_rate? | |
# CACHE |
This file contains 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 | |
# == Schema Information | |
# | |
# Table name: products | |
# | |
# id :bigint not null, primary key | |
# user_id :bigint | |
# title :string | |
# description :text |
This file contains 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 | |
class ProductsController < ApplicationController | |
# GET /products | |
def index | |
📗𝟮𝟬𝟬 ProductSerializer.new(filtered_products) | |
end | |
private |
This file contains 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 "redis" | |
worker_processes 8 | |
preload_app true | |
timeout 600 | |
listen '/tmp/vodeclic.sock', :backlog => 1024 | |
pid '/tmp/vodeclic.pid' | |
## | |
# REE |
This file contains 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
#!/bin/bash | |
rm -rf 5964832/ | |
git init . | |
mkdir boxes; touch boxes/.gitkeep | |
mkdir definitions; touch definitions/.gitkeep | |
mkdir instances; touch instances/.gitkeep | |
mkdir iso; touch iso/.gitkeep | |
mkdir .chef; touch .chef/.gitkeep | |
mkdir -p chef/cookbooks; touch chef/cookbooks/.gitkeep |
This file contains 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 'net/http' | |
require 'uri' | |
if ARGV[0].nil? | |
puts "Usage : #{$0} url [output] " | |
exit | |
end | |
class Crawler | |
attr_reader :url_list |
This file contains 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
?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 |
This file contains 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
gem 'meta_request' | |
gem "better_errors" | |
gem "binding_of_caller" | |
gem 'awesome_print' |
NewerOlder