[Jifty-commit] r5855 - Jifty-DBI/branches/tisql/t/tisql

Jifty commits jifty-commit at lists.jifty.org
Wed Sep 17 17:20:44 EDT 2008


Author: ruz
Date: Wed Sep 17 17:20:43 2008
New Revision: 5855

Modified:
   Jifty-DBI/branches/tisql/t/tisql/bench_tags.t

Log:
* adjust benchmark a little

Modified: Jifty-DBI/branches/tisql/t/tisql/bench_tags.t
==============================================================================
--- Jifty-DBI/branches/tisql/t/tisql/bench_tags.t	(original)
+++ Jifty-DBI/branches/tisql/t/tisql/bench_tags.t	Wed Sep 17 17:20:43 2008
@@ -16,9 +16,9 @@
 
 my @types = qw(article memo note);
 my @tags = qw(foo bar baz ball box apple orange fruit juice pearl gem briliant qwe asd zxc qwerty ytr dsa cxz boo bla);
-my $total_objs = 30000;
+my $total_objs = 3000;
 my $max_tags = 3;
-my $time_it = -10;
+my $time_it = -1;
 
 use Data::Dumper;
 
@@ -67,6 +67,8 @@
 sub run_our_cool_tests {
     my $collection = shift;
     my $handle = shift;
+    # turn off query cache in mysql
+    $handle->dbh->do("SET SESSION query_cache_type = OFF") if ref($handle) =~ /mysql/;
     my @tests = @_;
     foreach my $t ( @tests ) {
         diag "without bundling: ". do {
@@ -84,18 +86,16 @@
             $collection->build_select_query;
         };
         cmpthese( $time_it, {
-            "  $t" => sub { 
+            "  $t" => sub {
                 my $collection = TestApp::NodeCollection->new( handle => $handle );
-                my $tisql = $collection->tisql;
-                $tisql->{'joins_bundling'} = 0;
-                $tisql->query( $t );
+                $collection->tisql( joins_bundling => 0 )->query( $t );
+                $collection->rows_per_page(10);
                 $collection->next;
             },
             "b $t" => sub { 
                 my $collection = TestApp::NodeCollection->new( handle => $handle );
-                my $tisql = $collection->tisql;
-                $tisql->{'joins_bundling'} = 1;
-                $tisql->query( $t );
+                $collection->tisql( joins_bundling => 1 )->query( $t );
+                $collection->rows_per_page(10);
                 $collection->next;
             } }
         );
@@ -161,8 +161,8 @@
 };
 }
 
-my @xxx = ('a'..'z');
 sub init_data {
+    my @xxx = ('a'..'z');
     my @res = (
         [ 'type', 'subject' ],
     );


More information about the Jifty-commit mailing list