Skip to content

Instantly share code, notes, and snippets.

View shirosaki's full-sized avatar

Hiroshi Shirosaki shirosaki

View GitHub Profile
With long name conversion.
Run options: --seed 40925
# Running tests:
...................................S
Finished tests in 2.681746s, 13.4241 tests/s, 22.3735 assertions/s.
@shirosaki
shirosaki / bench.txt
Created February 18, 2012 11:57
Benchmark with skipping FindFirstFileW
Rails 3.2.1 empty app
ruby 2.0.0dev (2012-02-18 trunk 34670) [i386-mingw32]
X:\empty>timer ruby script\rails r 'p $:.size, $".size'
59
744
real 6.708
system 4.227
user 2.433
@shirosaki
shirosaki / webrick_long_name.patch
Created February 18, 2012 12:45
Long name conversion on webrick
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb
index 8736f57..e03db0f 100644
--- a/lib/webrick/httpservlet/filehandler.rb
+++ b/lib/webrick/httpservlet/filehandler.rb
@@ -327,12 +327,26 @@ module WEBrick
end
end
+ if /mswin|mingw/ =~ RUBY_PLATFORM
+ require 'Win32API'
--- a/configure.ac 2011-05-29 14:55:42 +0900
+++ b/configure.ac 2012-02-24 17:48:52 +0900
@@ -58,6 +58,13 @@
AC_CHECK_PROG(DOXYGEN, [doxygen], [true], [false])
AM_CONDITIONAL(DOXYGEN, [test "$DOXYGEN" = true])
+# Checks for host.
+case "$host_os" in
+ mingw*)
+ YAML_LT_LDFLAGS='-no-undefined';;
@shirosaki
shirosaki / fenix_win32_file.patch
Created March 6, 2012 15:01
Fenix integration
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"
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"
@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)
@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 / 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 / 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?
+