Skip to content

Instantly share code, notes, and snippets.

卜部昌平 shyouhei

Block or report user

Report or block shyouhei

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 0001-optimize-CLASS_OF.patch
From 98be06eba1e2f09bbfba9c63ec5f79581ad7a5fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
<shyouhei@ruby-lang.org>
Date: Wed, 23 Oct 2019 17:10:10 +0900
Subject: [PATCH] optimize CLASS_OF
---
include/ruby/ruby.h | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
View 0001-optimize-CLASS_OF.patch
From edb99670b714b12525f36d6f9b174a72a75026b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
<shyouhei@ruby-lang.org>
Date: Wed, 23 Oct 2019 17:10:10 +0900
Subject: [PATCH] optimize CLASS_OF
---
include/ruby/ruby.h | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
View 0001-greetings.patch
From 7b6bbba78cb2fcfb2a9def7d2c31aad64c03b5c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
<shyouhei@ruby-lang.org>
Date: Wed, 24 Jul 2019 16:29:59 +0900
Subject: [PATCH] greetings.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 卜部昌平 <shyouhei@ruby-lang.org>
@shyouhei
shyouhei / 1-README.md
Last active Jul 22, 2019
include-what-you-use is a garbage.
View 1-README.md
View 0001-send-pop-optimisation-part-two-eliminate-pop.patch
From 366e7e37b5f54c5d359a32f4324b6b90a6c7d33a Mon Sep 17 00:00:00 2001
From: "Urabe, Shyouhei" <shyouhei@ruby-lang.org>
Date: Mon, 21 Jan 2019 19:04:17 +0900
Subject: [PATCH] send-pop optimisation part two: eliminate pop
Sending a method, then immediately throwing away its return value, is
one of the most frequent waste of time that ruby does. Now that
callee methods can skip pushing objects onto the stack, why not caller
sites to also avoid popping them.
View 0001-print-N-gram-of-instructions-that-run.patch
From dc34706366802534e8f24b4efc312942c31cca72 Mon Sep 17 00:00:00 2001
From: "Urabe, Shyouhei" <shyouhei@ruby-lang.org>
Date: Wed, 5 Sep 2018 14:15:08 +0900
Subject: [PATCH] print N-gram of instructions that run
This is different from N-gram of generated iseq. Rather it prints
the sequence that was actually executed.
Signed-off-by: Urabe, Shyouhei <shyouhei@ruby-lang.org>
---
View gist:83770ceb3a8a08593b861482bc78f070
diff --git a/lib/crypt_checkpass/argon2.rb b/lib/crypt_checkpass/argon2.rb
index 08f22dd..c42f374 100644
--- a/lib/crypt_checkpass/argon2.rb
+++ b/lib/crypt_checkpass/argon2.rb
@@ -191,7 +191,7 @@ class CryptCheckpass::Argon2 < CryptCheckpass
require 'argon2'
@dll = Module.new do
extend FFI::Library
- lib = FFI::Compiler::Loader.find 'argon2_wrap'
+ lib = ::Argon2::Ext.ffi_libraries.first.name
View gist:02e4247dda1812735090b2b4c3be339a
diff --git a/string.c b/string.c
index 435954d313..8a264acef4 100644
--- a/string.c
+++ b/string.c
@@ -9220,11 +9220,9 @@ rb_str_crypt(VALUE str, VALUE salt)
{
#ifdef HAVE_CRYPT_R
VALUE databuf;
- struct crypt_data *data;
-# define CRYPT_END() ALLOCV_END(databuf)
View gist:43f157b0bb67987cceac80f56cbd1d49
Index: trunk/compile.c
===================================================================
--- trunk/compile.c (revision 63362)
+++ trunk/compile.c (working copy)
@@ -8929,7 +8929,7 @@
dump_body.ci_entries = ibf_dump_ci_entries(dump, iseq);
dump_body.cc_entries = NULL;
dump_body.variable.coverage = Qnil;
- dump_body.variable.original_iseq = Qnil;
+ dump_body.variable.original_iseq = NULL;
View putnil.patch
--- before.txt 2018-01-26 13:38:32.000000000 +0900
+++ after.txt 2018-01-26 13:38:57.000000000 +0900
@@ -719,15 +719,15 @@ miniruby[0x1002259d7] <+3223>: movq %r
miniruby[0x1002259da] <+3226>: movq %r15, %rsi
miniruby[0x1002259dd] <+3229>: vzeroupper
miniruby[0x1002259e0] <+3232>: callq 0x100218b00 ; vm_trace at vm_insnhelper.c:3805
-miniruby[0x1002259e5] <+3237>: leaq 0x8(%r14), %rax
-miniruby[0x1002259e9] <+3241>: movq %r14, %rcx
-miniruby[0x1002259ec] <+3244>: movq %rax, (%r15)
-miniruby[0x1002259ef] <+3247>: movq %rax, %r14
You can’t perform that action at this time.