6 use Time::HiRes qw(gettimeofday tv_interval);
7 use Digest::SHA 'sha1_hex';
10 BEGIN { $ENV{DBICTEST_ANFANG_DEFANG} = 1 };
13 my $schema = DBICTest->init_schema(
15 cursor_class => 'DBIx::Class::Cursor::Cached'
19 my $c = Cache::FileCache->new({ namespace => 'SchemaClass' });
23 my $t0 = [gettimeofday];
25 # getting a fresh rs makes sure we do not cache anything
26 my $rs = $schema->resultset("Artist")->search({},{
28 cache_for => 999999999999,
31 ( { tracks => { cd_single => { artist => { cds => { tracks => 'cd_single' } } } } } ) x 50,
37 my $q = ${$rs->as_query}->[0];
39 print STDERR "@{[ length $q]} byte-long query generated (via as_query() in: ".tv_interval($t0) . " seconds (take $i)\n";
41 # stuff below can be made even faster, but another time
44 $t0 = [ gettimeofday ];
47 print STDERR "Got collapsed results (via HRI) in: ".tv_interval($t0) . " seconds (take $i)\n";