Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jasonroelofs on github.
  • I am jasonroelofs (https://keybase.io/jasonroelofs) on keybase.
  • I have a public key whose fingerprint is 97E0 6FE4 76E9 6B2E 1C02 03FA 9EB6 09A6 1157 F583

To claim this, I am signing this object:

class Something
def
def my_method
puts "I got: #{my_method}"
end
end
s = Something.new
s.def("something")
@jasonroelofs
jasonroelofs / master.bench
Created May 30, 2014 20:24
Liquid benchmarking comparing render profiling changes
Ruby 2.1.2 -- Master
$ ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse: 4.180000 0.030000 4.210000 ( 4.205455)
parse & run: 8.670000 0.010000 8.680000 ( 8.687521)
-------------------------------------- total: 12.890000sec
user system total real
parse: 4.100000 0.020000 4.120000 ( 4.112649)
@jasonroelofs
jasonroelofs / master.txt
Last active August 29, 2015 14:02
Benchmark and Profile of Liquid performance with alias_method hooks (Ruby 2.1.2)
] rake benchmark:run benchmark:strict profile:run profile:strict
ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse: 4.420000 0.030000 4.450000 ( 4.455098)
parse & run: 9.050000 0.030000 9.080000 ( 9.078304)
-------------------------------------- total: 13.530000sec
user system total real
parse: 4.320000 0.020000 4.340000 ( 4.339127)
parse & run: 8.810000 0.020000 8.830000 ( 8.832378)
@jasonroelofs
jasonroelofs / 1_template.liquid
Created June 10, 2014 01:18
Example profiling of liquid template
{% include 'header' %}
<h1>{{ item.title }}</h1>
{{ request.host }}
{{ item.data.body }}
@jasonroelofs
jasonroelofs / Shopify master
Last active August 29, 2015 14:04
Liquid Profiler benchmarking with CPU and Object
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
$ ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse: 3.410000 0.020000 3.430000 ( 3.428711)
parse & run: 7.490000 0.010000 7.500000 ( 7.500437)
-------------------------------------- total: 10.930000sec
user system total real
@jasonroelofs
jasonroelofs / 1) Master
Created July 31, 2014 18:40
Liquid profiler -- benchmarks against master
/Users/roelofs/.rvm/rubies/ruby-2.1.2/bin/ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse: 3.660000 0.020000 3.680000 ( 3.688094)
parse & run: 7.710000 0.010000 7.720000 ( 7.723662)
-------------------------------------- total: 11.400000sec
user system total real
parse: 3.480000 0.010000 3.490000 ( 3.491892)
parse & run: 7.650000 0.020000 7.670000 ( 7.662562)
@jasonroelofs
jasonroelofs / 1 - master
Created August 12, 2014 19:17
Shopify profiling benchmarks
/Users/roelofs/.rvm/rubies/ruby-2.1.2/bin/ruby ./performance/benchmark.rb lax
Running benchmark for 60 seconds (with 5 seconds warmup).
Calculating -------------------------------------
parse: 2 i/100ms
parse & run: 1 i/100ms
-------------------------------------------------
parse: 28.3 (±7.1%) i/s - 1690 in 60.040297s
parse & run: 13.9 (±7.2%) i/s - 833 in 60.043217s
/// All config-related options handled here
extern crate serialize;
use std::collections::HashMap;
use std::path::posix::Path;
use std::io::File;
use serialize::json;
#[deriving(Decodable, Encodable, Show)]
" Make ',e' (in normal mode) give a prompt for opening files
" in the same dir as the current buffer's file.
if has("unix")
map ,e :e <C-R>=expand("%:p:h") . "/" <CR>
else
map ,e :e <C-R>=expand("%:p:h") . "\\" <CR>
endif