Skip to content

Instantly share code, notes, and snippets.

Sadayuki Furuhashi frsyuki

Block or report user

Report or block frsyuki

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 compiling-ruby-for-poc.sh
./configure \
$(ruby -e "puts RbConfig::CONFIG['configure_args']") \
CFLAGS=$(ruby -e "puts RbConfig::CONFIG['CFLAGS'] + ' -flto'") \
LDFLAGS=$(ruby -e "puts RbConfig::CONFIG['LDFLAGS'] + ' -flto'") \
--enable-shared \
--prefix=$(pwd)/install
View a-MJIT-LTO.md
require 'benchmark'
Benchmark.bmbm do |x|
  x.report("Array.push") do
    arrays = []
    1000.times do |i|
      arrays[i] = []
      (0...500000).each do |j|
        arrays[i] = j
      end
View result.md

No optimization:

        user     system      total        real
0.1kb   1.204809   0.005060   1.209869 (  1.210884)
1kb     1.309668   0.004896   1.314564 (  1.315971)
10kb    2.674302   0.077470   2.751772 (  2.755213)
100kb  29.982771  22.375113  52.357884 ( 52.386822)
500kb 122.625423  82.284026 204.909449 (205.018250)
600kb   1.006700   0.003676   1.010376 (  1.010782)
View rubykaigi2019-profiler.rb
require 'benchmark'
require 'json'
require 'yajl'
require 'msgpack'
here = File.dirname(File.expand_path(__FILE__))
# https://catalog.data.gov/dataset/consumer-complaint-database
VIEWS_OBJ = JSON.load(File.read("#{here}/views.json"))
VIEWS_MSGPACK = MessagePack.pack(VIEWS_OBJ)
View DigdagMultistageOperatorUtilityIdea.java
public class Multistage<P>
{
public static class State<T>
{
private Object nextLambdaArgument;
private boolean isNext;
private State(Object nextLambdaArgument, boolean isNext)
{
View Gemfile
source 'https://rubygems.org/'
gemspec
View doorkeeper-solve-distributed-race-condition
Example:
* (00:01:01): Initial state: client stores access_token=a01 and refresh_token=r01.
API DB access_tokens table is as following:
| access_token | refresh_token | previous_refresh_token | expires_in | created_at | revoked_at |
| a01 | r01 | | 3605 | 00:00:01 | |
* (00:02:02): Client refreshes token using refresh_token=r01.
It gets access_token=a02 and refresh_token=r02.
View kafka-ksql-msgpack.patch
diff --git a/ksql-core/pom.xml b/ksql-core/pom.xml
index afa072a..0a889b0 100644
--- a/ksql-core/pom.xml
+++ b/ksql-core/pom.xml
@@ -44,6 +44,11 @@
</dependency>
<dependency>
+ <groupId>org.msgpack</groupId>
+ <artifactId>msgpack-core</artifactId>
View msgpack-ruby-frozen-str-cache.diff
diff --git a/ext/msgpack/buffer.h b/ext/msgpack/buffer.h
index 9387254..5c8af67 100644
--- a/ext/msgpack/buffer.h
+++ b/ext/msgpack/buffer.h
@@ -20,6 +20,7 @@
#include "compat.h"
#include "sysdep.h"
+#include "frozen_str_cache.h"
View MethodTypeCheckable-experimental.rb
module HasSize
def size
end
end
module MethodTypeCheckable
def method_type_check(name, signature)
origin = self.instance_method(name)
define_method(name) do |*args, &block|
You can’t perform that action at this time.