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

theory / fsa-rules
98%

Build:
DEFAULT BRANCH: master
Repo Added 14 Mar 2015 03:51AM UTC
Files 1
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

LAST BUILD ON BRANCH master
branch: master
CHANGE BRANCH
x
Reset
  • master
  • set_note
  • v0.35

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

Relevant lines Covered
Build:
Build:
264 RELEVANT LINES 259 COVERED LINES
293.44 HITS PER LINE
Source Files on master
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
29 master 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; ... Pull #8 08 Jun 2015 02:08AM UTC glasswalk3r travis-ci pending completion  
28 master Enable spelling tests on Travis. push 27 Mar 2015 07:09PM UTC theory travis-ci pending completion  
27 master Increment to v0.36. push 16 Mar 2015 04:13PM UTC theory travis-ci pending completion  
25 master Timestamp v0.35. push 16 Mar 2015 04:06PM UTC theory travis-ci pending completion  
24 master Let the installer install Rest::Weaken. So that hopefully it will avoid doing so on 5.6, since it is not supported there. push 15 Mar 2015 11:53PM UTC theory travis-ci pending completion  
23 master Require Storable 2.05. push 15 Mar 2015 11:33PM UTC theory travis-ci pending completion  
22 master Install Test::Weaken on Travis. push 15 Mar 2015 10:58PM UTC theory travis-ci pending completion  
21 master Try installing GraphViz. push 15 Mar 2015 10:54PM UTC theory travis-ci pending completion  
20 master Try to build and test without sudo. push 15 Mar 2015 10:51PM UTC theory travis-ci pending completion  
19 master Fix failing GraphViz tests. By using debug output instead of canonical output. Resolves #7. push 15 Mar 2015 10:40PM UTC theory travis-ci pending completion  
See All Builds (16)
  • Repo on GitHub
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

© 2025 Coveralls, Inc