]> git.wincent.com - wikitext.git/commit
Add sanity checks to parsing benchmark scripts
authorWincent Colaiuta <win@wincent.com>
Sun, 10 May 2009 23:44:11 +0000 (01:44 +0200)
committerWincent Colaiuta <win@wincent.com>
Sun, 10 May 2009 23:44:11 +0000 (01:44 +0200)
commit2ba0cb6769c496d5b57da3373de35eca538cc6f3
treecb6273dfaa08fd12b839d6786969c166b37731bb
parent0946140dbde4f75a63e95a6f31980215f0fd7cf2
Add sanity checks to parsing benchmark scripts

After the grand refactoring there are evidently still some lingering
low-level errors, because the benchmarking scripts are bailing with
an "overlong encoding" error after a certain period of time (full
output below).

I've added some sanity checks to the scripts to try and catch discrepancies
but so far none have been discovered.

Here is the full output of the run (this one for "parsing.rb", but the
results are similar for "profile_parsing.rb"):

Rehearsal -------------------------------------------------------------
short slab of ASCII text    1.800000   0.020000   1.820000 (  2.182344)
short slab of UTF-8 text    3.540000   0.030000   3.570000 (  4.127638)
longer slab of ASCII text  14.600000   0.140000  14.740000 ( 17.301072)
longer slab of UTF-8 text  46.150000   0.490000  46.640000 ( 58.118039)
--------------------------------------------------- total: 66.770000sec

user     system      total        real
short slab of ASCII text    1.800000   0.020000   1.820000 (  2.087143)
short slab of UTF-8 text    3.580000   0.040000   3.620000 (  4.315676)
longer slab of ASCII text  14.680000   0.160000  14.840000 ( 18.018380)
longer slab of UTF-8 text benchmarks/parsing.rb:321:in `parse': invalid
  encoding: overlong encoding (Wikitext::Parser::Error)
  from benchmarks/parsing.rb:321:in `parse'
  from benchmarks/parsing.rb:320:in `times'
  from benchmarks/parsing.rb:320:in `parse'
  from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/...
  from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/...
  from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/...
  from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/...
  from benchmarks/parsing.rb:331

Signed-off-by: Wincent Colaiuta <win@wincent.com>
benchmarks/parsing.rb
benchmarks/profile_parsing.rb