Skip to content

Instantly share code, notes, and snippets.

View eregon's full-sized avatar

Benoit Daloze eregon

View GitHub Profile
--- full.txt 2020-03-05 17:04:32.230794000 +0900
+++ short.txt 2020-03-05 17:04:38.445322000 +0900
@@ -1,179 +1,3 @@
-1.8.5-p52
-1.8.5-p113
-1.8.5-p114
-1.8.5-p115
-1.8.5-p231
-1.8.6
-1.8.6-p36
@eregon
eregon / results.txt
Last active February 22, 2020 12:01
Running OptCarrot on 22/02/2020
From https://github.com/mame/optcarrot@master (80760d237159e84a8e6f937de35d0001c59275a6)
with
$ $RUBY bin/optcarrot -b --print-fps-history -f 3000 examples/Lan_Master.nes
--print-fps-history to verify the final score is close to the rest
-f 3000 to make sure there is more than enough warmup
Using the latest release of each implementation.
$ ruby ...
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
#!/usr/bin/env ruby
require "open-uri"
require "json"
unless ARGV[0] =~ %r{\Ahttps://bugs.ruby-lang.org/issues/(\d+)\z}
puts "Usage: #$0 https://bugs.ruby-lang.org/issues/XXXX"
exit 1
end
require_relative '../../spec_helper'
require 'thread'
describe "ConditionVariable#signal" do
it "returns self if nothing to signal" do
cv = ConditionVariable.new
cv.signal.should == cv
end
it "returns self if something is waiting for a signal" do
require_relative '../../spec_helper'
require 'thread'
describe "ConditionVariable#signal" do
it "returns self if nothing to signal" do
cv = ConditionVariable.new
cv.signal.should == cv
end
it "returns self if something is waiting for a signal" do
@eregon
eregon / kwargs2.rb
Last active November 24, 2019 22:21
def length1(a, b, c)
a.size + b.size + c.size
end
def length2(a, b, c)
a.size + b.size + c.size
end
def length3(a, b, c)
a.size + b.size + c.size
# Using a custom #measure method to minimize overhead and code loaded
def measure
t0 = Process.clock_gettime(Process::CLOCK_THREAD_CPUTIME_ID, :nanosecond)
yield
t1 = Process.clock_gettime(Process::CLOCK_THREAD_CPUTIME_ID, :nanosecond)
puts (t1-t0)/1e9
end
def req(x)
x
@eregon
eregon / rvm-times.rb
Last active February 7, 2019 10:23
Analyse RVM --trace output
lines = File.readlines(ARGV[0], chomp: true)
min_time = Float(ARGV[1] || 1.0)
data = lines.grep(/^[+]+\s*(\d+\.\d+)/).map { |line|
line =~ /^[+]+\s*(\d+\.\d+)/ or raise line
[Float($1), $']
}
class Float
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eregon
eregon / Gemfile
Created July 25, 2018 15:23
truffleruby tests
# frozen_string_literal: true
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# ruby '2.6'
# Full-stack web application framework.
gem 'rails', github: 'rails/rails'