Skip to content

Instantly share code, notes, and snippets.

Noah Gibbs noahgibbs

Block or report user

Report or block noahgibbs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View threads.rb
# Here is maybe something closer to what I'd try...
require 'thread'
def fib( n )
return n if ( 0..1 ).include? n
( fib( n - 1 ) + fib( n - 2 ) )
thread_execution_time = {|h, k| h[k] = [] }
View thread_vs_fork_test.patch
C02RP0G1G8WM:pipe noah.gibbs$ diff -c thread_test.rb fork_test.rb
*** thread_test.rb 2019-08-30 19:04:45.000000000 -0700
--- fork_test.rb 2019-08-30 16:15:08.000000000 -0700
*** 8,14 ****
if ARGV.size != 2
! STDERR.puts "Usage: ./thread_test <num_workers> <num_requests>"
exit 1
noahgibbs / multiply.rb
Created Aug 3, 2019
Simple "multiply two numbers" benchmark w/ MJIT output
View multiply.rb
def multiply(a, b)
a * b
1_000_000.times do
multiply(7.0, 10.0)
noahgibbs / multiply.rb.c
Created Jul 19, 2019
An MJIT file generated from multiply.rb by prerelease Ruby 2.7
View multiply.rb.c
/* block in <main>@./multiply.rb:5 */
ALWAYS_INLINE(static VALUE _mjit_inlined_6(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE orig_self, const rb_iseq_t *original_iseq));
static inline VALUE
_mjit_inlined_6(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE orig_self, const rb_iseq_t *original_iseq)
const VALUE *orig_pc = reg_cfp->pc;
noahgibbs / r00lz.rb
Created Apr 28, 2019
R00lz.to_underscore, for those who hate typing out regexps visually.
View r00lz.rb
# r00lz/lib/r00lz.rb
module R00lz
def self.to_underscore(s)
noahgibbs / discourse_jit_error.txt
Created Dec 4, 2018
Internal error during benchmarking 2.6.0pre3
View discourse_jit_error.txt
+ RUBYOPT=--jit
+ ./start.rb -i 10000 -w 100 -s 0 --no-warm-start -o data/
WARN: Unresolved or ambigious specs during Gem::Specification.reset:
unf_ext (>= 0)
Available/installed versions of this gem:
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
Please report a bug if this causes problems.
/home/ubuntu/.rvm/gems/ruby-2.6.0-preview3/gems/onebox-1.8.6/lib/onebox/preview.rb:5: warning: constant Net::HTTPServerException is deprecated
noahgibbs / action_cable_weird_shit.txt
Created Aug 3, 2018
View action_cable_weird_shit.txt
You can .send() from JavaScript and .receive() from Ruby. But if you use "action" as a field in the hash, it treats it as a named action and receive() doesn't work.
Reloading. In general, reloading is a weird process. Reloading the browser can sometimes but not always reload the Ruby classes. Channel objects don't seem to reliably reload on the Ruby side, just in general.
In the documentation, streams vs channels. How they're named, how they're used.
Multiple ActionCable servers. Which is why "disconnect" operates by sending a pub/sub message to all servers to disconnect everybody "identified_by" what you sent.
Identified_by. Never really explained. Seems to only be usable for .disconnect?
noahgibbs / gist:f006364c3b335046314d9cdcbaa5c4d6
Created Jul 16, 2018
Robert Pozen writing advice, very abbreviated notes
View gist:f006364c3b335046314d9cdcbaa5c4d6
Make an Outline:
* Brainstorm
* Categorize (arrange into categories and subcategories)
* Outline
* Provide the Reader with Context
* State the main theme
* Explain the organization (what you'll get, how you'll get it)
noahgibbs / index.html
Created May 23, 2017
Rails Ruby Bench Throughput by Ruby Version
View index.html
<!-- Embeddable, not full-page -->
<link type="text/css" rel="stylesheet" href="">
<link type="text/css" rel="stylesheet" href="">
<link type="text/css" rel="stylesheet" href="">
<!-- <link type="text/css" rel="stylesheet" href="css/extensions.css"> -->
<!-- Note: Rickshaw uses D3.js version 3, not 4 -->
<script src=""></script>
<script src=""></script>
noahgibbs / benchmark_data.txt
Created Apr 19, 2017
Raw run data from Rails Ruby Bench
View benchmark_data.txt
Ruby Version: 2.0.0, data points: 15000, full runs: 10
0%ile: 0.0068682490000000485
1%ile: 0.011501136530000072
5%ile: 0.022750594349999993
10%ile: 0.035768121299999844
50%ile: 0.1570052820000003
90%ile: 0.3480380704999999
95%ile: 0.41832731610000007
99%ile: 0.6091764846900004
100%ile: 1.117286536
You can’t perform that action at this time.