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 'benchmark' | |
require 'ostruct' | |
REP = 1000000 | |
User = Struct.new(:name, :age) | |
USER = "User".freeze | |
AGE = 21 | |
HASH = {:name => USER, :age => AGE}.freeze |
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
================== | |
== UN PATCHED ==== | |
================== | |
-- create_table(:posts, {:force=>true}) | |
D, [2015-04-07T21:48:33.198419 #6407] DEBUG -- : (0.3ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "comments_count" integer DEFAULT 0) | |
-> 0.0067s | |
-- create_table(:comments, {:force=>true}) | |
D, [2015-04-07T21:48:33.198977 #6407] DEBUG -- : (0.1ms) CREATE TABLE "comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "post_id" integer) | |
-> 0.0005s |
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 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do | |
create_table :posts do |t| | |
t.integer :comments_count, default: 0 |
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
date | wounds | other | disease | |
---|---|---|---|---|
5/1854 | 0 | 95 | 105 | |
6/1854 | 0 | 40 | 95 | |
7/1854 | 0 | 140 | 520 | |
8/1854 | 20 | 150 | 800 | |
9/1854 | 220 | 230 | 740 | |
10/1854 | 305 | 310 | 600 | |
11/1854 | 480 | 290 | 820 | |
12/1854 | 295 | 310 | 1100 | |
1/1855 | 230 | 460 | 1440 |
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
{ | |
"rows" : [ | |
{ | |
"attribute" : "Some attribute", | |
"id" : "id_0", | |
"very_important" : 0.2, | |
"important" : 0.2, | |
"not_very_important" : 0.2, | |
"not_at_all_important" : 0.2, | |
"do_not_know" : 0.2 |