#!/usr/bin/perl use strict; use warnings; use Local::DBIC_Schema; use Benchmark qw(cmpthese); my $schema = Local::DBIC_Schema->connect( 'DBI:SQLite:pktm' ); cmpthese( 100_000, { first => sub { my ($ding) = $schema->resultset('T')->search( undef, { order_by => 'testid DESC', } )->first; }, slicer => sub { my ($ding2) = $schema->resultset('T')->search( undef, { order_by => 'testid DESC', } )->slice(0,1); }, } );