Created
February 18, 2012 11:57
-
-
Save shirosaki/1858996 to your computer and use it in GitHub Desktop.
Benchmark with skipping FindFirstFileW
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
X:\empty>timer ruby script\rails r 'p $:.size, $".size' | |
59 | |
744 | |
real 6.692 | |
system 4.227 | |
user 2.464 | |
X:\empty>timer ruby script\rails r 'p $:.size, $".size' | |
59 | |
744 | |
real 6.692 | |
system 4.570 | |
user 2.106 | |
patched ruby 2.0.0dev (2012-02-18 trunk 34670) [i386-mingw32] | |
X:\empty>timer ruby script\rails r 'p $:.size, $".size' | |
59 | |
744 | |
real 2.418 | |
system 0.920 | |
user 1.513 | |
X:\empty>timer ruby script\rails r 'p $:.size, $".size' | |
59 | |
744 | |
real 2.402 | |
system 0.811 | |
user 1.606 | |
X:\empty>timer ruby script\rails r 'p $:.size, $".size' | |
59 | |
744 | |
real 2.418 | |
system 0.686 | |
user 1.684 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/file.c b/file.c | |
index 11e9766..39aacc2 100644 | |
--- a/file.c | |
+++ b/file.c | |
@@ -3196,7 +3196,8 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result) | |
wstr = ALLOCV_N(WCHAR, v, len); | |
MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, wstr, len); | |
if (tmp != result) rb_str_resize(tmp, 0); | |
- h = FindFirstFileW(wstr, &wfd); | |
+// h = FindFirstFileW(wstr, &wfd); | |
+ h = INVALID_HANDLE_VALUE; | |
ALLOCV_END(v); | |
if (h != INVALID_HANDLE_VALUE) { | |
size_t wlen; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment