2009/8/9 Roger Pack <rogerdpack / gmail.com>:
> Currently when I run "gem env" on a windows machine
>
> with 1.8.6 it takes [~80 gems installed]
>
> real  0m0.360s
>
> with 1.9.1 [~80 gems]
>
> real  0m1.610s
>
> with 1.9.2 [~40 gems]
>
> real  0m1.140s
>
> [all with 1.3.5 installed]
>
> Not so for Linux--1.9.2 seems slightly faster than 1.8.6 for its gem list.
>
> Anybody have any inkling as to what's going on here?
> Thanks!
I guess the slowdown is due to the following lines from io.c

#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
/* Windows */
# define NEED_NEWLINE_DECORATOR_ON_READ(fptr) (!(fptr->mode & FMODE_BINMODE))
# define NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) (!(fptr->mode & FMODE_BINMODE))
# define TEXTMODE_NEWLINE_DECORATOR_ON_WRITE ECONV_CRLF_NEWLINE_DECORATOR
#else
/* Unix */
# define NEED_NEWLINE_DECORATOR_ON_READ(fptr) (fptr->mode & FMODE_TEXTMODE)
# define NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) 0
#endif

On windows, default mode regarded as text mode and
NEED_NEWLINE_DECORATOR_ON_READ is set. On the contrary, on Linux,
default mode regarded as binary mode and
NEED_NEWLINE_DECORATOR_ON_READ is not set.


Regards,

Park Heesob