http://www.perlmonks.org?node_id=587107


in reply to Re^2: When should I use a dispatch table?
in thread When should I use a dispatch table?

chromatic already has the IO part handled but your comparison is also getting dwarfed by making those function calls. Remove those too, they're one of the more expensive things you can do in perl (except for IO and just deliberately sleeping).

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

  • Comment on Re^3: When should I use a dispatch table?

Replies are listed 'Best First'.
Re^4: When should I use a dispatch table?
by Limbic~Region (Chancellor) on Dec 01, 2006 at 13:35 UTC
    diotalevi,
    Remove what function calls? The ones that make the dispatch table a dispatch table and subsequently the exact thing I am benchmarking? While I value chromatic's opinion (and your's), there is no IO involved. He was making the point that it is silly to worry about a few microseconds here and there if your program was doing IO.

    So what are you guys trying to say - it is pointless to Benchmark any program that does IO or has function calls? I specifically isolated the bench to the difference between an if/elsif chain and its equivalent dispatch table. I appreciate constructive critism but I am not seeing it here.

    Cheers - L~R