• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

theory / fsa-rules / 29
98%

Build:
DEFAULT BRANCH: master
Ran 08 Jun 2015 02:08AM UTC
Jobs 7
Files 1
Run time 4min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
29

Pull #8

travis-ci

glasswalk3r
Performance enhancement for notes() method
Rewrite the method code to avoid unnecessary variable assignments and
jumping straight to the requested operation

Original times (from NYTProf):

sub notes {
  832	176431	25.2ms			    my $self = shift;
  833	176431	84.2ms			    my $fsa = $machines{$self};
  834	176431	22.2ms			    return $fsa->{notes} unless
  @_;
  835	176431	28.2ms			    my $key = shift;
  836	176431	386ms			    return $fsa->{notes}{$key}
  unless @_;
  837	44880	19.2ms			    $fsa->{notes}{$key} = shift;
  838	44880	110ms			    return $self;
  839					}

  After the change:

  sub notes {
    832
    833	176431	41.4ms		        return $machines{$_[0]}->{notes} if ($#_ == 0);
    834	176431	445ms			return $machines{$_[0]}->{notes}->{$_[1]} if ($#_ == 1);
    835	44880	46.8ms			$machines{$_[0]}->{notes}->{$_[1]} = $_[2] if ($#_ == 2);
    836	44880	115ms			return $_[0];
    837 }

It seems a small improvement (for having a not so easy to read code) but I'm invoking a lot of times this method
Pull Request #8: Performance enhancement for notes() method

4 of 4 new or added lines in 1 file covered. (100.0%)

259 of 264 relevant lines covered (98.11%)

293.44 hits per line

Jobs
ID Job ID Ran Files Coverage
4 29.4 (COVERAGE=1) 08 Jun 2015 02:08AM UTC 0
97.97
Travis Job 29.4
5 29.5 (COVERAGE=1) 08 Jun 2015 02:08AM UTC 0
97.97
Travis Job 29.5
6 29.6 (COVERAGE=1) 08 Jun 2015 02:09AM UTC 0
97.97
Travis Job 29.6
7 29.7 (COVERAGE=1) 08 Jun 2015 02:09AM UTC 0
97.97
Travis Job 29.7
8 29.8 (COVERAGE=1) 08 Jun 2015 02:09AM UTC 0
97.97
Travis Job 29.8
9 29.9 (COVERAGE=1) 08 Jun 2015 02:09AM UTC 0
97.98
Travis Job 29.9
10 29.10 (COVERAGE=1) 08 Jun 2015 02:12AM UTC 0
97.98
Travis Job 29.10
Source Files on build 29
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #29
  • Pull Request #8
  • PR Base - master (#28)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc