Skip to content

Instantly share code, notes, and snippets.

View shirosaki's full-sized avatar

Hiroshi Shirosaki shirosaki

View GitHub Profile
@shirosaki
shirosaki / 1-faster_load.patch
Created August 8, 2012 08:08
Remove short name expansion only on require and load
diff --git a/file.c b/file.c
index 4050067..4c86c27 100644
--- a/file.c
+++ b/file.c
@@ -2883,7 +2883,7 @@ append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encodi
}
static VALUE
-file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
+file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, VALUE result, int long_name)
@shirosaki
shirosaki / 1-winstat.patch
Created August 7, 2012 13:44
winnt_stat optimize patch
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index de17d7e..434c93c 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -819,6 +819,13 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal(0, File::Stat.new(@zerofile).size)
end
+ def test_stat_special_file
+ # test for special files such as pagefile.sys on Windows
@shirosaki
shirosaki / winnt_stat.patch
Created August 6, 2012 22:12
Winstat patch which adds root path check
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index a19fcd9..7d1716b 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -813,6 +813,13 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal(0, File::Stat.new(@zerofile).size)
end
+ def test_stat_special_file
+ # test for special files such as pagefile.sys on Windows
@shirosaki
shirosaki / 1-winstat.patch
Created August 3, 2012 14:13
Winstat patch
diff --git a/win32/win32.c b/win32/win32.c
index 458b613..8640ddd 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4554,18 +4554,11 @@ check_valid_dir(const WCHAR *path)
{
WIN32_FIND_DATAW fd;
HANDLE fh;
- WCHAR full[MAX_PATH];
- WCHAR *dmy;
@shirosaki
shirosaki / fix_test_win32ole_variant.patch
Created July 30, 2012 00:42
Set US-English locale with test_win32ole_variant
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
index 70bfc8b..62ff217 100644
--- a/test/win32ole/test_win32ole_variant.rb
+++ b/test/win32ole/test_win32ole_variant.rb
@@ -306,6 +306,8 @@ if defined?(WIN32OLE_VARIANT)
end
def test_s_array
+ WIN32OLE.locale = 0x0409 # set US-English locale - number with decimal point
+
@shirosaki
shirosaki / post.patch
Created May 16, 2012 16:58
faster-windows-ruby-requires.md
diff --git a/_site_src/content/posts/2012-05-15-faster-windows-ruby-requires.md b/_site_src/content/posts/2012-05-15-faster-windows-ruby-requires.md
index 6f0ada8..160f518 100644
--- a/_site_src/content/posts/2012-05-15-faster-windows-ruby-requires.md
+++ b/_site_src/content/posts/2012-05-15-faster-windows-ruby-requires.md
@@ -49,6 +49,67 @@ int main(int argc, char *argv[])
<% end %>
</code></pre>
+## Why the current Ruby 1.9.3 is so slow on startup?
+
@shirosaki
shirosaki / fenix_integration.patch
Created March 26, 2012 14:00
fenix integration win32/file.c
diff --git a/configure.in b/configure.in
index 9b44842..83ed4c9 100644
--- a/configure.in
+++ b/configure.in
@@ -1055,7 +1055,7 @@ main()
AC_CHECK_FUNCS(cygwin_conv_path)
AC_LIBOBJ([langinfo])
],
-[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp $LIBS"
+[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp -lshlwapi $LIBS"
@shirosaki
shirosaki / bench.txt
Created March 20, 2012 04:41
Add processing of rb_get_path_check
user system total real
Ruby '' 0.032000 0.000000 0.032000 ( 0.031200)
Fenix '' 0.031000 0.000000 0.031000 ( 0.031200)
Plain '' 0.031000 0.000000 0.031000 ( 0.031200)
Ruby '.' 0.031000 0.000000 0.031000 ( 0.031200)
Fenix '.' 0.031000 0.000000 0.031000 ( 0.031200)
Plain '.' 0.032000 0.000000 0.032000 ( 0.031200)
Ruby 'foo', 'bar' 0.031000 0.000000 0.031000 ( 0.031200)
Fenix 'foo', 'bar' 0.047000 0.000000 0.047000 ( 0.046800)
Plain 'foo', 'bar' 0.031000 0.000000 0.031000 ( 0.031200)
@shirosaki
shirosaki / gist:2057307
Created March 17, 2012 10:11
fenix bench
Fenix patched ruby 2.0.0dev (2012-03-17 trunk 35075) [i386-mingw32]
user system total real
Ruby '' 0.031000 0.000000 0.031000 ( 0.030002)
Fenix '' 0.016000 0.000000 0.016000 ( 0.025001)
Plain '' 0.031000 0.000000 0.031000 ( 0.027002)
Ruby '.' 0.031000 0.000000 0.031000 ( 0.029001)
Fenix '.' 0.032000 0.000000 0.032000 ( 0.025001)
Plain '.' 0.031000 0.000000 0.031000 ( 0.028002)
Ruby 'foo', 'bar' 0.031000 0.000000 0.031000 ( 0.038002)
diff --git a/configure.in b/configure.in
index 9a679de..aad31de 100644
--- a/configure.in
+++ b/configure.in
@@ -1055,7 +1055,7 @@ main()
AC_CHECK_FUNCS(cygwin_conv_path)
AC_LIBOBJ([langinfo])
],
-[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp $LIBS"
+[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp -lshlwapi $LIBS"