Version 5 of filesystem benchmarking

Updated 2004-01-06 17:01:15

Some aspects of Tcl's filesystem (glob, file, pwd, cd primarily) became a bit slower with the vfs layer that was introduced in Tcl 8.4.0. This has gradually been addressed with later Tcl 8.4.x releases and also with Tcl 8.5.x. The current timings are as follows:

000 VERSIONS
1:8.5a0 2:8.4.5 3:8.3.5
    001 FILE exec interp                              11390   11825   10120
    002 FILE exec interp: exit                        11451   12000   11910
    003 FILE exec interp: pkg require                 49464   63563   26840
    004 FILE exec interp: pkg require+                74524   89706   45733
    005 FILE exec interp: pkg require+auto_path       57918   78988   37400
    006 FILE exists tmpfile (obj)                        20      21      30
    007 FILE exists ~                                    11      12      30
    008 FILE exists! absolute tmpfile (obj)              17      18      20
    009 FILE exists! absolute tmpfile (str)              23     193      21
    010 FILE exists! relative tmpfile (obj)              14      18      10
    011 FILE exists! relative tmpfile (str)              18     339      20
    012 FILE exists! tmpfile (obj)                       20      21      20
    013 FILE exists! tmpfile (str)                       26     274      20
    014 FILE glob  tmpdir (30 entries) / -dir          4582    4627    4500
    015 FILE glob  tmpdir (30 entries) / cd            5067    5226    4510
    016 FILE glob  tmpdir (subset of 30 entries)       2324    4613    4400
    017 FILE glob / all subcommands                   72873   62841  101750
    018 FILE glob / atime                              6219    7240   11510
    019 FILE glob / attributes                        47786   46769   45560
    020 FILE glob / dirname                            5385    5345    4910
    021 FILE glob / executable                         7925    6901    5610
    022 FILE glob / exists                             6957    6803    5600
    023 FILE glob / extension                          5031    4868    4610
    024 FILE glob / isdirectory                        6459    7253   12620
    025 FILE glob / isfile                             7563    7198   12220
    026 FILE glob / mtime                              6466    7232   12210
    027 FILE glob / owned                              6505    7238   12220
    028 FILE glob / readable                          10518    6771    5510
    029 FILE glob / rootname                           4842    4816    4610
    030 FILE glob / size                               6516    7309   11410
    031 FILE glob / tail                               5111    5046    4710
    032 FILE glob / writable                          10940    6775    6810
    033 FILE glob deep dirs (30 entries+)             53471   52319   44770
    034 FILE glob deep dirs (subset of 30 entries+)   34275   51626   42360
    035 FILE glob dirs (30 entries)                    4751    4554   11310
    036 FILE recurse / -dir                           90779  100767  128590
    037 FILE recurse / cd                             99308  164254  126180
    038 FILE recurse+stat / -dir                     118139  134507  225530
    039 FILE recurse+stat / cd                       123270  194716  219610
    040 FILE standard directory 'package require'     55761   54815  777467
    040 BENCHMARKS                                  1:8.5a0 2:8.4.5 3:8.3.5

(This is for a slightly modified version of file.bench, and a slightly modified version of Tcl 8.5a0 which is undergoing performance testing, where the above timings are on WinXP. Also see end of page for a normalized version).

If you have particular pieces of code using file, glob which are slower in Tcl 8.4/8.5, please add them to this page so that they can be added to the benchmark suite.

Note: reading from and writing to files is a totally separate topic, i.e. channel i/o, which has nothing to do with the vfs changes made to Tcl 8.4.0, and is therefore irrelevant to the particular benchmarking exercise on this page.


Same data, normalized:

000 VERSIONS
1:8.5a0 2:8.4.5 3:8.3.5
    001 FILE exec interp                               1.10    1.16    1.00
    002 FILE exec interp: exit                         1.10    1.16    1.00
    003 FILE exec interp: pkg require                  1.88    2.40    1.00
    004 FILE exec interp: pkg require+                 1.82    2.18    1.00
    005 FILE exec interp: pkg require+auto_path        1.53    2.08    1.00
    006 FILE exists tmpfile (obj)                      1.05    1.05    1.00
    007 FILE exists ~                                  0.37    0.40    1.00
    008 FILE exists! absolute tmpfile (obj)            0.85    0.90    1.00
    009 FILE exists! absolute tmpfile (str)            1.15    9.70    1.00
    010 FILE exists! relative tmpfile (obj)            0.65    0.90    1.00
    011 FILE exists! relative tmpfile (str)            1.80   33.50    1.00
    012 FILE exists! tmpfile (obj)                     1.00    1.05    1.00
    013 FILE exists! tmpfile (str)                     1.30   14.05    1.00
    014 FILE glob  tmpdir (30 entries) / -dir          1.08    1.04    1.00
    015 FILE glob  tmpdir (30 entries) / cd            1.19    1.17    1.00
    016 FILE glob  tmpdir (subset of 30 entries)       0.55    1.07    1.00
    017 FILE glob / all subcommands                    0.72    0.63    1.00
    018 FILE glob / atime                              0.55    0.64    1.00
    019 FILE glob / attributes                         1.05    1.10    1.00
    020 FILE glob / dirname                            1.11    1.10    1.00
    021 FILE glob / executable                         1.43    1.20    1.00
    022 FILE glob / exists                             1.07    1.23    1.00
    023 FILE glob / extension                          1.03    1.05    1.00
    024 FILE glob / isdirectory                        0.56    0.63    1.00
    025 FILE glob / isfile                             0.55    0.63    1.00
    026 FILE glob / mtime                              0.55    0.63    1.00
    027 FILE glob / owned                              0.56    0.63    1.00
    028 FILE glob / readable                           1.78    1.22    1.00
    029 FILE glob / rootname                           1.02    1.04    1.00
    030 FILE glob / size                               0.56    0.63    1.00
    031 FILE glob / tail                               1.07    1.05    1.00
    032 FILE glob / writable                           1.78    1.22    1.00
    033 FILE glob deep dirs (30 entries+)              1.19    1.21    1.00
    034 FILE glob deep dirs (subset of 30 entries+)    0.78    1.24    1.00
    035 FILE glob dirs (30 entries)                    0.41    0.41    1.00
    036 FILE recurse / -dir                            0.68    0.80    1.00
    037 FILE recurse / cd                              0.79    1.29    1.00
    038 FILE recurse+stat / -dir                       0.52    0.60    1.00
    039 FILE recurse+stat / cd                         0.57    0.89    1.00
    040 FILE standard directory 'package require'      0.07    0.07    1.00
    040 BENCHMARKS                                  1:8.5a0 2:8.4.5 3:8.3.5