# require$B$,CY$/$J$k(B

**URL:** <https://www.ruby-forum.com/t/require-b-cy-j-k-b/189489>\
**Category:** Development\
**Created:** [June 1, 2010, 6:33pm UTC](https://www.ruby-forum.com/t/require-b-cy-j-k-b/189489 "2010-06-01T18:33:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miura\_Hideki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@Miura\_Hideki](https://www.ruby-forum.com/u/Miura_Hideki)\
**Post date:** [June 1, 2010, 6:33pm UTC](https://www.ruby-forum.com/t/require-b-cy-j-k-b/189489/1 "2010-06-01T18:33:01Z")

</div>

e$B;01:$H?=$7$^$9!#e(B

1e$BG/$V$j$/$i$$$K:G?7%P!\<%8%g%s$Ne(BRubye$B$Ge(Byarv2llvme$B$rF0$+$7$F$_$?$i!"e(B  
e$B$9$4$/;~4V$,$+$+$k$h$&$K$J$C$F$$$?$N$GD4$Y$F$_$^$7$?!#e(B  
e$B4D6-$O0J2\<$NDL$j$G$9!#e(B  
e$B!!!e(BCPU AMD Athlon™X2 Dual-Core QL-60 1.90 GHz

e$B!!e(BRAM 4GBytes

```
OS Windows Vista

```

CYGWIN\_NT-6.0 miura-PC 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin

Ruby ruby 1.9.3dev (2010-05-30 trunk 28086) [i386-cygwin]

e$B$=$N7k2L!"e(Brequiree$B;~$K%U%!%$%kF~NO$N8e$KBgNL$Ne(BRead/Writee$B$G$O$J$$e(B  
File Operatione$B$,H/@8$7$F$$$k$3$H$,J,$+$j$^$7$?!#e(B  
e$B$5$i$K!“e(Bstrace(Cygwine$BHGe(B)e$B$r8+$?$H$3$m!”\<!$N$h$&$J%7%9%F%`%3!\<%k$,e(B  
e$BBgNL$KH/@8$7$F$$$^$7$?!#e(B

857 67985110 [main] ruby 4896 open: open  
(/home/miura/demo/yarv2llvm64/yarv2llvm/lib/vmtraverse.rb, 0x0)  
101 67985211 [main] ruby 4896 normalize\_posix\_path: src  
/home/miura/demo/yarv2llvm64/yarv2llvm/lib/vmtraverse.rb  
96 67985307 [main] ruby 4896 normalize\_posix\_path:  
/home/miura/demo/yarv2llvm64/yarv2llvm/lib/vmtraverse.rb =  
normalize\_posix\_path  
(/home/miura/demo/yarv2llvm64/yarv2llvm/lib/vmtraverse.rb)  
96 67985403 [main] ruby 4896 mount\_info::conv\_to\_win32\_path:  
conv\_to\_win32\_path  
(/home/miura/demo/yarv2llvm64/yarv2llvm/lib/vmtraverse.rb)  
96 67985499 [main] ruby 4896 set\_flags: flags: binary (0x2)  
90 67985589 [main] ruby 4896 mount\_info::conv\_to\_win32\_path: src\_path  
/home/miura/demo/yarv2llvm64/yarv2llvm/lib/vmtraverse.rb, dst  
C:\cygwin\home\miura\demo\yarv2llvm64\yarv2llvm\lib\vmtraverse.rb, flags  
0x3000A, rc 0  
954 67986543 [main] ruby 4896 symlink\_info::check: 0x0 = NtCreateFile  
(??\C:\cygwin\home\miura\demo\yarv2llvm64\yarv2llvm\lib\vmtraverse.rb)  
352 67986895 [main] ruby 4896 symlink\_info::check: not a symlink  
575 67987470 [main] ruby 4896 symlink\_info::check: 0 = symlink.check  
(C:\cygwin\home\miura\demo\yarv2llvm64\yarv2llvm\lib\vmtraverse.rb,  
0x22A320) (0x3000A)  
156 67987626 [main] ruby 4896 path\_conv::check:  
this-\>path(C:\cygwin\home\miura\demo\yarv2llvm64\yarv2llvm\lib\vmtraverse.rb),  
has\_acls(1)  
144 67987770 [main] ruby 4896 build\_fh\_pc: fh 0x612269D4  
103 67987873 [main] ruby 4896 fhandler\_base::open:  
(??\C:\cygwin\home\miura\demo\yarv2llvm64\yarv2llvm\lib\vmtraverse.rb,  
0x100000)  
711 67988584 [main] ruby 4896 fhandler\_base::set\_flags: flags  
0x100000,  
supplied\_bin 0x10000

e$B$3$l$r8+$k8B$j!"e(BCygwine$B$G$O%U%!%$%k$N%Q%9$rF@$k$?$a$Ke(B  
e$B%U%!%$%k%7%9%F%`$N%"%/%;%9$r4^$`7k9==E$$=hM}$r9T$C$F$$$k$h$&$G$9!#e(B

e$B$=$3$G!"%U%!%$%k%Q%9$r7+$jJV$7F@$k=hM}$r$7$F$$$k$H$3$m$re(B  
e$BC5$7$?$H$3$m!"e(Biseq.ce$B$Ne(Bprepare\_iseq\_builde$BCf$Ne(B

iseq-\>filepath = filepath == Qnil ? Qnil : rb\_realpath\_internal(Qnil,  
filepath, 1);

e$B$,8+$D$+$j$^$7$?!#;n$7$Ke(Biseq-\>filepathe$B$r\>o$Ke(BQnile$B$K$9$k$h$&$KJQ99e(B  
e$B$7$F!"\<B9TB.EY$N:9$r8+$F$\_$^$7$?!#e(B

e$B7k2L$G$9!#e(B  
time ruby -I . yarv2llvm.rb fib.rb

e$B%\*%j%8%J%ke(B  
real 0m35.954s  
user 0m4.163s  
sys 0m14.351s

e$B\>o$Ke(BQnile$B!!!e(B  
real 0m10.323s  
user 0m2.525s  
sys 0m3.197s

e$B$^$?!"e(Brb\_realpath\_internal(Qnil, filepath,  
1)e$B$N7k2L$r%-%c%C%7%e$9$ke(B  
e$B$h$&$K$7$F$\_$^$7$?!#$=$N7k2L$G$9!#e(B

e$B%-%c%C%7%ee(B  
real 0m26.757s  
user 0m3.291s  
sys 0m10.623s

e$B$3$N\<B83$G;H$C$?JQ99E@$r0J2\<$K\<($7$^$9!#e(B  
e$B$J$\*!"e(Biseq\_s\_compilee$B$Ne(B

- rb\_scan\_args(argc, argv, “13”, &src, &file, &path, &line, &opt);

- rb\_scan\_args(argc, argv, “14”, &src, &file, &path, &line, &opt);  
e$B$OD\>@\4X78$J$$$N$G$9$,!"$D$$$G$K\>h$;$F$\*$-$^$9!#e(B  
e$B$3$A$i$b8f8!F$$7$F$b$i$($k$H9,$$$G$9!#e(B

# Index: iseq.c

— iseq.c (revision 28086)  
+++ iseq.c (working copy)  
@@ -217,7 +217,22 @@

VALUE rb\_realpath\_internal(VALUE basedir, VALUE path, int strict);

+static VALUE path\_cache;  
+static VALUE realpath\_cache;  
static VALUE  
+realpath\_iseq(VALUE path)  
+{

- if (path\_cache == path) {
- 

```
   return realpath_cache;

```

- }
- 
- path\_cache = path;
- realpath\_cache = rb\_realpath\_internal(Qnil, path, 1);
- 
- return realpath\_cache;  
+}
- 

+static VALUE  
prepare\_iseq\_build(rb\_iseq\_t \*iseq,  
VALUE name, VALUE filename, VALUE filepath, VALUE line\_no,  
VALUE parent, VALUE type, VALUE block\_opt,  
@@ -228,7 +243,9 @@

```
 iseq->name = name;
 iseq->filename = filename;

```

- iseq-\>filepath = filepath == Qnil ? Qnil :  
rb\_realpath\_internal(Qnil,  
filepath, 1);

- //iseq-\>filepath = filepath == Qnil ? Qnil :  
rb\_realpath\_internal(Qnil,  
filepath, 1);

- iseq-\>filepath = filepath == Qnil ? Qnil : realpath\_iseq(filepath);

- // iseq-\>filepath = Qnil;  
iseq-\>line\_no = (unsigned short)line\_no; /\* TODO: really enough? \*/  
iseq-\>defined\_method\_id = 0;  
iseq-\>mark\_ary = rb\_ary\_tmp\_new(3);  
@@ -579,7 +596,7 @@

- rb\_scan\_args(argc, argv, “13”, &src, &file, &path, &line, &opt);

- rb\_scan\_args(argc, argv, “14”, &src, &file, &path, &line, &opt);  
if (NIL\_P(file)) file = rb\_str\_new2("");  
if (NIL\_P(line)) line = INT2FIX(1);

@@ -1516,5 +1533,7 @@  
rb\_define\_singleton\_method(rb\_cISeq, “compile\_option=”,  
iseq\_s\_compile\_option\_set, 1);  
rb\_define\_singleton\_method(rb\_cISeq, “disasm”, iseq\_s\_disasm, 1);  
rb\_define\_singleton\_method(rb\_cISeq, “disassemble”, iseq\_s\_disasm,  
1);  
+

- rb\_global\_variable(&path\_cache);  
}
