Skip to content

Instantly share code, notes, and snippets.

@jonforums
Created July 21, 2011 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonforums/1097249 to your computer and use it in GitHub Desktop.
Save jonforums/1097249 to your computer and use it in GitHub Desktop.
Investigating MRI 1.9.x file reading performance regressions
## microbenchmark for binary reading of file with CRLF endings
C:\projects\measurements-git>pik run rci bench core_brd_filelines_crlf
jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [Windows 7-x86-java]
Rehearsal -----------------------------------------------------------
core_brd_filelines_crlf 2.139000 0.000000 2.139000 ( 2.109000)
-------------------------------------------------- total: 2.139000sec
user system total real
core_brd_filelines_crlf 2.057000 0.000000 2.057000 ( 2.057000)
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
Rehearsal -----------------------------------------------------------
core_brd_filelines_crlf 1.560000 0.265000 1.825000 ( 1.982113)
-------------------------------------------------- total: 1.825000sec
user system total real
core_brd_filelines_crlf 1.497000 0.265000 1.762000 ( 1.959112)
ruby 1.9.2p290 (2011-07-09 revision 32478) [i386-mingw32]
Rehearsal -----------------------------------------------------------
core_brd_filelines_crlf 0.998000 0.125000 1.123000 ( 1.176067)
-------------------------------------------------- total: 1.123000sec
user system total real
core_brd_filelines_crlf 0.998000 0.187000 1.185000 ( 1.192068)
ruby 1.9.4dev (2011-07-21 trunk 32590) [i386-mingw32]
Rehearsal -----------------------------------------------------------
core_brd_filelines_crlf 0.967000 0.187000 1.154000 ( 1.214069)
-------------------------------------------------- total: 1.154000sec
user system total real
core_brd_filelines_crlf 0.998000 0.140000 1.138000 ( 1.165066)
## microbenchmark for binary reading of file with LF endings
C:\projects\measurements-git>pik run rci bench core_brd_filelines_lf
jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [Windows 7-x86-java]
Rehearsal ---------------------------------------------------------
core_brd_filelines_lf 2.126000 0.000000 2.126000 ( 2.100000)
------------------------------------------------ total: 2.126000sec
user system total real
core_brd_filelines_lf 2.025000 0.000000 2.025000 ( 2.025000)
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
Rehearsal ---------------------------------------------------------
core_brd_filelines_lf 1.544000 0.328000 1.872000 ( 1.972113)
------------------------------------------------ total: 1.872000sec
user system total real
core_brd_filelines_lf 1.669000 0.156000 1.825000 ( 1.890108)
ruby 1.9.2p290 (2011-07-09 revision 32478) [i386-mingw32]
Rehearsal ---------------------------------------------------------
core_brd_filelines_lf 0.967000 0.140000 1.107000 ( 1.155066)
------------------------------------------------ total: 1.107000sec
user system total real
core_brd_filelines_lf 0.952000 0.187000 1.139000 ( 1.162066)
ruby 1.9.4dev (2011-07-21 trunk 32590) [i386-mingw32]
Rehearsal ---------------------------------------------------------
core_brd_filelines_lf 0.952000 0.203000 1.155000 ( 1.195069)
------------------------------------------------ total: 1.155000sec
user system total real
core_brd_filelines_lf 0.983000 0.187000 1.170000 ( 1.200068)
## microbenchmark for normal reading of file with CRLF endings
C:\projects\measurements-git>pik run rci bench core_rd_filelines_crlf
jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [Windows 7-x86-java]
Rehearsal ----------------------------------------------------------
core_rd_filelines_crlf 3.853000 0.000000 3.853000 ( 3.826000)
------------------------------------------------- total: 3.853000sec
user system total real
core_rd_filelines_crlf 3.629000 0.000000 3.629000 ( 3.628000)
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
Rehearsal ----------------------------------------------------------
core_rd_filelines_crlf 1.856000 0.156000 2.012000 ( 2.146123)
------------------------------------------------- total: 2.012000sec
user system total real
core_rd_filelines_crlf 1.779000 0.281000 2.060000 ( 2.560147)
ruby 1.9.2p290 (2011-07-09 revision 32478) [i386-mingw32]
Rehearsal ----------------------------------------------------------
core_rd_filelines_crlf 19.781000 0.187000 19.968000 ( 20.216156)
------------------------------------------------ total: 19.968000sec
user system total real
core_rd_filelines_crlf 19.672000 0.156000 19.828000 ( 20.153152)
ruby 1.9.4dev (2011-07-21 trunk 32590) [i386-mingw32]
Rehearsal ----------------------------------------------------------
core_rd_filelines_crlf 18.236000 0.094000 18.330000 ( 18.392052)
------------------------------------------------ total: 18.330000sec
user system total real
core_rd_filelines_crlf 17.675000 0.078000 17.753000 ( 17.846020)
## microbenchmark for normal reading of file with LF endings
C:\projects\measurements-git>pik run rci bench core_rd_filelines_lf
jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [Windows 7-x86-java]
Rehearsal --------------------------------------------------------
core_rd_filelines_lf 3.174000 0.000000 3.174000 ( 3.145000)
----------------------------------------------- total: 3.174000sec
user system total real
core_rd_filelines_lf 3.102000 0.000000 3.102000 ( 3.103000)
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
Rehearsal --------------------------------------------------------
core_rd_filelines_lf 1.560000 0.234000 1.794000 ( 1.795103)
----------------------------------------------- total: 1.794000sec
user system total real
core_rd_filelines_lf 1.607000 0.172000 1.779000 ( 1.776102)
ruby 1.9.2p290 (2011-07-09 revision 32478) [i386-mingw32]
Rehearsal --------------------------------------------------------
core_rd_filelines_lf 17.628000 0.063000 17.691000 ( 17.672011)
---------------------------------------------- total: 17.691000sec
user system total real
core_rd_filelines_lf 17.363000 0.078000 17.441000 ( 17.438998)
ruby 1.9.4dev (2011-07-21 trunk 32590) [i386-mingw32]
Rehearsal --------------------------------------------------------
core_rd_filelines_lf 17.269000 0.109000 17.378000 ( 17.434997)
---------------------------------------------- total: 17.378000sec
user system total real
core_rd_filelines_lf 17.597000 0.078000 17.675000 ( 17.667010)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment