Perlblog entries for 2010-03-03

Some simple "white-space trim" benchmarks

Date: Wednesday, 3 March 2010, 15:38.

Categories: perl, ironman, benchmarking, trim, regexp, optimization, basic, tutorial.

Laufeyjarson asked on Monday, about stripping whitespace from both ends of a string. The comments contains lots of suggestions, but no hard figures, so I thought I'd reproduce them here along with the code used to generate the benchmarks - it provides a simple example of how to write a quick and reliable benchmark.

Browse Perlblog Subscribe to Perlblog

By day of March: 03 05 09 10 18 27 31

By month of 2010: March April May June July August September November

By year: 2010 2011

Or by: category or series.

© 2009-2011 Sam Graham, unless otherwise noted. All rights reserved.