← Index
NYTProf Performance Profile   « line view »
For webmerge/scripts/webmerge.pl
  Run on Mon Oct 7 02:42:42 2013
Reported on Mon Oct 7 03:03:19 2013

Filename/home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/OCBNET/Spritesets/Corner.pm
StatementsExecuted 823 statements in 54.5ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
481150.7ms60.7msOCBNET::Spritesets::Corner::::layoutOCBNET::Spritesets::Corner::layout
48412.42ms8.73msOCBNET::Spritesets::Corner::::newOCBNET::Spritesets::Corner::new
6421701µs701µsOCBNET::Spritesets::Corner::::isRightOCBNET::Spritesets::Corner::isRight
6421677µs677µsOCBNET::Spritesets::Corner::::isBottomOCBNET::Spritesets::Corner::isBottom
11184µs184µsOCBNET::Spritesets::Corner::::BEGIN@10OCBNET::Spritesets::Corner::BEGIN@10
11159µs92µsOCBNET::Spritesets::Corner::::BEGIN@11OCBNET::Spritesets::Corner::BEGIN@11
11150µs444µsOCBNET::Spritesets::Corner::::BEGIN@16OCBNET::Spritesets::Corner::BEGIN@16
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1###################################################################################################
2# Copyright 2013 by Marcel Greter
3# This file is part of Webmerge (GPL3)
4####################################################################################################
5# this block can only contain one sprite
6####################################################################################################
7package OCBNET::Spritesets::Corner;
8####################################################################################################
9
102164µs2285µs
# spent 184µs (84+100) within OCBNET::Spritesets::Corner::BEGIN@10 which was called: # once (84µs+100µs) by OCBNET::Spritesets::BEGIN@27 at line 10
use strict;
# spent 184µs making 1 call to OCBNET::Spritesets::Corner::BEGIN@10 # spent 100µs making 1 call to strict::import
112183µs2124µs
# spent 92µs (59+33) within OCBNET::Spritesets::Corner::BEGIN@11 which was called: # once (59µs+33µs) by OCBNET::Spritesets::BEGIN@27 at line 11
use warnings;
# spent 92µs making 1 call to OCBNET::Spritesets::Corner::BEGIN@11 # spent 33µs making 1 call to warnings::import
12
13####################################################################################################
14
15# a container is also a block
1621.45ms2839µs
# spent 444µs (50+395) within OCBNET::Spritesets::Corner::BEGIN@16 which was called: # once (50µs+395µs) by OCBNET::Spritesets::BEGIN@27 at line 16
use base 'OCBNET::Spritesets::Container';
# spent 444µs making 1 call to OCBNET::Spritesets::Corner::BEGIN@16 # spent 395µs making 1 call to base::import
17
18####################################################################################################
19
20# create a new object
21# ******************************************************************************
22sub new
23
# spent 8.73ms (2.42+6.32) within OCBNET::Spritesets::Corner::new which was called 48 times, avg 182µs/call: # 12 times (712µs+1.57ms) by OCBNET::Spritesets::Canvas::new at line 93 of webmerge/scripts/modules/OCBNET/Spritesets/Canvas.pm, avg 190µs/call # 12 times (566µs+1.60ms) by OCBNET::Spritesets::Canvas::new at line 94 of webmerge/scripts/modules/OCBNET/Spritesets/Canvas.pm, avg 180µs/call # 12 times (573µs+1.57ms) by OCBNET::Spritesets::Canvas::new at line 96 of webmerge/scripts/modules/OCBNET/Spritesets/Canvas.pm, avg 179µs/call # 12 times (568µs+1.57ms) by OCBNET::Spritesets::Canvas::new at line 95 of webmerge/scripts/modules/OCBNET/Spritesets/Canvas.pm, avg 178µs/call
{
24
25 # get package name, parent and options
2648187µs my ($pckg, $parent, $right, $bottom) = @_;
27
28 # get object by calling super class
29481.32ms486.32ms my $self = $pckg->SUPER::new($parent);
# spent 6.32ms making 48 calls to OCBNET::Spritesets::Container::new, avg 132µs/call
30
31 # set the options for the corner
3248147µs $self->{'is-right'} = $right;
334873µs $self->{'is-bottom'} = $bottom;
34
35 # return object
3648698µs return $self;
37
38}
39
40####################################################################################################
41
42# getter methods for the specific options
43# ******************************************************************************
446443.1ms
# spent 701µs within OCBNET::Spritesets::Corner::isRight which was called 64 times, avg 11µs/call: # 32 times (386µs+0s) by OCBNET::Spritesets::Corner::layout at line 68, avg 12µs/call # 32 times (315µs+0s) by OCBNET::Spritesets::Corner::layout at line 69, avg 10µs/call
sub isRight { return $_[0]->{'is-right'}; }
45641.05ms
# spent 677µs within OCBNET::Spritesets::Corner::isBottom which was called 64 times, avg 11µs/call: # 32 times (373µs+0s) by OCBNET::Spritesets::Corner::layout at line 67, avg 12µs/call # 32 times (304µs+0s) by OCBNET::Spritesets::Corner::layout at line 70, avg 9µs/call
sub isBottom { return $_[0]->{'is-bottom'}; }
46
47####################################################################################################
48
49# calculate positions and dimensions
50# ******************************************************************************
51sub layout
52
# spent 60.7ms (50.7+9.98) within OCBNET::Spritesets::Corner::layout which was called 48 times, avg 1.26ms/call: # 48 times (50.7ms+9.98ms) by OCBNET::Spritesets::Canvas::Layout::layout at line 108 of webmerge/scripts/modules/OCBNET/Spritesets/Canvas/Layout.pm, avg 1.26ms/call
{
53
54 # get our object
5548145µs my ($self) = @_;
56
57 # do nothing if empty
5848744µs48717µs return if $self->empty;
# spent 717µs making 48 calls to OCBNET::Spritesets::Container::empty, avg 15µs/call
59
60 # check if we really only have one child
6132443µs32397µs die "illegal state" if $self->length != 1;
# spent 397µs making 32 calls to OCBNET::Spritesets::Container::length, avg 12µs/call
62
63 # get the only sprite in the corner
6432172µs my $sprite = $self->{'children'}->[0];
65
66 # remove unnecessary paddings
6732549µs48572µs $sprite->paddingTop = 0 if not $self->isBottom;
# spent 373µs making 32 calls to OCBNET::Spritesets::Corner::isBottom, avg 12µs/call # spent 198µs making 16 calls to OCBNET::Spritesets::Block::paddingTop, avg 12µs/call
6832590µs48623µs $sprite->paddingLeft = 0 if not $self->isRight;
# spent 386µs making 32 calls to OCBNET::Spritesets::Corner::isRight, avg 12µs/call # spent 236µs making 16 calls to OCBNET::Spritesets::Block::paddingLeft, avg 15µs/call
6932475µs48477µs $sprite->paddingRight = 0 if $self->isRight;
# spent 315µs making 32 calls to OCBNET::Spritesets::Corner::isRight, avg 10µs/call # spent 162µs making 16 calls to OCBNET::Spritesets::Block::paddingRight, avg 10µs/call
7032481µs48502µs $sprite->paddingBottom = 0 if $self->isBottom;
# spent 304µs making 32 calls to OCBNET::Spritesets::Corner::isBottom, avg 9µs/call # spent 199µs making 16 calls to OCBNET::Spritesets::Block::paddingBottom, avg 12µs/call
71
72 # fix position to zero
7332379µs32350µs $sprite->left = 0;
# spent 350µs making 32 calls to OCBNET::Spritesets::Block::left, avg 11µs/call
7432335µs32331µs $sprite->top = 0;
# spent 331µs making 32 calls to OCBNET::Spritesets::Block::top, avg 10µs/call
75
76 # use the dimension of the sprite
7732666µs643.03ms $self->width = $sprite->outerWidth;
# spent 2.70ms making 32 calls to OCBNET::Spritesets::Block::outerWidth, avg 84µs/call # spent 325µs making 32 calls to OCBNET::Spritesets::Block::width, avg 10µs/call
7832645µs642.99ms $self->height = $sprite->outerHeight;
# spent 2.67ms making 32 calls to OCBNET::Spritesets::Block::outerHeight, avg 83µs/call # spent 317µs making 32 calls to OCBNET::Spritesets::Block::height, avg 10µs/call
79
80 # return success
8132515µs return $self;
82
83}
84# EO sub layout
85
86
87####################################################################################################
88####################################################################################################
89112µs1;