← Index
NYTProf Performance Profile   « line view »
For ./move_planets.pl
  Run on Tue Jan 23 21:11:41 2024
Reported on Tue Jan 23 21:12:47 2024

Filename/aoa_test/cron/db/mysql.pl
StatementsExecuted 9068 statements in 2.36s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11079147.1ms2.43smain::::db_domyquerymain::db_domyquery
11113.9ms21.7msmain::::BEGIN@6.1main::BEGIN@6.1
11128µs69µsmain::::BEGIN@8.2main::BEGIN@8.2
11119µs163µsmain::::db_closemain::db_close
21118µs20.1msmain::::db_openmain::db_open
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#!/usr/local/bin/perl -wT
2#
3# $Id: mysql.pl 537 2018-12-22 15:14:55Z tiggr $
4#
5
62187µs221.7ms
# spent 21.7ms (13.9+7.87) within main::BEGIN@6.1 which was called: # once (13.9ms+7.87ms) by main::RUNTIME at line 6
use DBI;
# spent 21.7ms making 1 call to main::BEGIN@6.1 # spent 15µs making 1 call to Exporter::import
7
82248µs2109µs
# spent 69µs (28+41) within main::BEGIN@8.2 which was called: # once (28µs+41µs) by main::RUNTIME at line 8
use CGI::Carp;
# spent 69µs making 1 call to main::BEGIN@8.2 # spent 41µs making 1 call to CGI::Carp::import
9
10
# spent 20.1ms (18µs+20.1) within main::db_open which was called 2 times, avg 10.0ms/call: # 2 times (18µs+20.1ms) by main::db_setup at line 12 of /aoa_test/cron/dbsetup.pl, avg 10.0ms/call
sub db_open {
1123µs my ($database, $host, $user, $password)=@_;
12215µs220.1ms return DBI->connect("DBI:mysql:$database:$host",$user,$password) || carp "Can't connect to $database on $host: $DBI::errstr";
# spent 20.1ms making 2 calls to DBI::connect, avg 10.0ms/call
13}
14
15
# spent 163µs (19+144) within main::db_close which was called: # once (19µs+144µs) by main::RUNTIME at line 96 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl
sub db_close {
161166µs1144µs $_[0]->disconnect;
# spent 144µs making 1 call to DBI::db::disconnect
17}
18
19
# spent 2.43s (47.1ms+2.38) within main::db_domyquery which was called 1107 times, avg 2.19ms/call: # 184 times (7.75ms+1.13s) by main::RUNTIME at line 81 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 6.20ms/call # 184 times (15.0ms+832ms) by main::RUNTIME at line 78 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 4.60ms/call # 184 times (5.75ms+172ms) by main::RUNTIME at line 85 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 966µs/call # 184 times (6.40ms+98.2ms) by main::RUNTIME at line 83 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 568µs/call # 184 times (5.41ms+88.2ms) by main::RUNTIME at line 87 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 509µs/call # 184 times (5.65ms+48.9ms) by main::RUNTIME at line 89 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl, avg 296µs/call # once (100µs+4.27ms) by main::RUNTIME at line 93 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl # once (987µs+1.19ms) by main::RUNTIME at line 51 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl # once (108µs+1.60ms) by main::RUNTIME at line 43 of /server-root/ashesofangels.com/htdocs/test/cron/tick/move_planets.pl
sub db_domyquery {
2011071.68ms my($dbh,$query)=@_;
2111077.80ms2214144ms my $sth=$dbh->prepare($query);
# spent 77.2ms making 1107 calls to DBI::db::prepare, avg 70µs/call # spent 67.0ms making 1107 calls to DBD::mysql::db::prepare, avg 61µs/call
22 #print "$query\n";
2311072.30s11072.29s $sth->execute || confess("can't domyquery $query: $dbh->errstr");
# spent 2.29s making 1107 calls to DBI::st::execute, avg 2.07ms/call
24 # build an array up of pointers to the rows
25 # and return the array
261107857µs my @returned;
27110715.5ms22124.56ms if($query=~/^select/i || $query=~/^show/i) {
# spent 4.56ms making 2212 calls to main::CORE:match, avg 2µs/call
2821µs my $a=0;
292969µs200382µs while(my(@list)=$sth->fetchrow_array) {
# spent 382µs making 200 calls to DBI::st::fetchrow_array, avg 2µs/call
30198257µs push @returned, @list;
31 }
32 }
3311073.15ms11071.00ms if($query=~/^insert/i) {
# spent 1.00ms making 1107 calls to main::CORE:match, avg 904ns/call
34 return $dbh->{'mysql_insertid'};
35 }
3611076.78ms11073.42ms $sth->finish;
# spent 3.42ms making 1107 calls to DBI::st::finish, avg 3µs/call
37110726.8ms33214.12ms return @returned;
# spent 3.14ms making 2214 calls to DBI::common::DESTROY, avg 1µs/call # spent 987µs making 1107 calls to DBD::_mem::common::DESTROY, avg 892ns/call
38}
39
4013µs1;