The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Cache::Profile::Compare - Compare several caches

VERSION

version 0.06

SYNOPSIS

    my $c = Cache::Profile::Compare->new(
        caches => [
            Cache::Bounded->new({ interval => 256, size => 1024 }),
            Cache::Ref::LRU->new( size => 1024 ),
            Cache::Ref::CART->new( size => 1024 ),
        ],
    );

    # use normally
    $c->get("foo");
    $c->set("foo" => 42);

    # reports which cache had the best hit rate, and which provided the best
    # speedup
    $c->report;

DESCRIPTION

This module lets you compare several profiles.

ATTRIBUTES

caches

The caches to profile

profiles

A lazy built list of Cache::Profile or Cache::Profile::CorrelateMissTiming objects based on caches.

Can be provided explicitly if you want to create your own profiler objects.

profile_class

Defaults to Cache::Profile::CorrelateMissTiming.

METHODS

report

Prints the reports of the cache with the largest speedup and the cache with the best hit rate.

by_speedup

Returns the caches sorted by speedup.

by_hit_rate

Returns the caches sorted by hit rate.

SUPPORT

Bugs may be submitted through the RT bug tracker (or bug-Cache-Profile@rt.cpan.org).

AUTHOR

יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>

COPYRIGHT AND LICENCE

This software is copyright (c) 2010 by יובל קוג'מן (Yuval Kogman).

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.