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

DavyJonesLocker / client_side_validations / 542
100%
main: 100%

Build:
Build:
LAST BUILD BRANCH: releases/23.1.0
DEFAULT BRANCH: main
Ran 18 Dec 2016 01:07PM UTC
Jobs 12
Files 29
Run time 5min
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
542

push

travis-ci

tagliala
Improve build_validation_options method

Use `<<` instead of string interpolation

```ruby
require 'benchmark/ips'

def interpolation(options)
  name = 'name'
  name = "#{name}#{options[:multiple] ? '[]' : nil}"
end

def push(options)
  name = 'name'
  name << '[]' if options[:multiple]
end

Benchmark.ips do |x|
  x.report('interpolation (true)')  { interpolation(multiple: true) }
  x.report('interpolation (false)')  { interpolation(multiple: false) }
  x.report('push (true)') { push(multiple: true) }
  x.report('push (false)') { push(multiple: false) }
  x.compare!
end
```

Result:

```
$ ruby bench.rb 
Warming up --------------------------------------
interpolation (true)    85.563k i/100ms
interpolation (false)
                        79.544k i/100ms
         push (true)    96.962k i/100ms
        push (false)   108.172k i/100ms
Calculating -------------------------------------
interpolation (true)      1.231M (± 5.1%) i/s -      6.161M in   5.017881s
interpolation (false)
                          1.144M (± 5.0%) i/s -      5.727M in   5.018903s
         push (true)      1.402M (± 7.7%) i/s -      6.981M in   5.013148s
        push (false)      1.529M (±11.0%) i/s -      7.572M in   5.021825s

Comparison:
        push (false):  1528576.6 i/s
         push (true):  1402083.9 i/s - same-ish: difference falls within error
interpolation (true):  1230966.2 i/s - 1.24x  slower
interpolation (false):  1144093.1 i/s - 1.34x  slower
```

593 of 595 relevant lines covered (99.66%)

257.4 hits per line

Jobs
ID Job ID Ran Files Coverage
1 542.1 (2.0.0, gemfiles/rails_4.0.gemfile) 18 Dec 2016 01:07PM UTC 0
99.49
Travis Job 542.1
2 542.2 (2.0.0, gemfiles/rails_4.1.gemfile) 18 Dec 2016 01:07PM UTC 0
99.49
Travis Job 542.2
3 542.3 (2.0.0, gemfiles/rails_4.2.gemfile) 18 Dec 2016 01:08PM UTC 0
99.49
Travis Job 542.3
4 542.4 (2.1.10, gemfiles/rails_4.0.gemfile) 18 Dec 2016 01:07PM UTC 0
99.49
Travis Job 542.4
5 542.5 (2.1.10, gemfiles/rails_4.1.gemfile) 18 Dec 2016 01:07PM UTC 0
99.49
Travis Job 542.5
6 542.6 (2.1.10, gemfiles/rails_4.2.gemfile) 18 Dec 2016 01:10PM UTC 0
99.49
Travis Job 542.6
7 542.7 (2.2.6, gemfiles/rails_4.0.gemfile) 18 Dec 2016 01:09PM UTC 0
99.49
Travis Job 542.7
8 542.8 (2.2.6, gemfiles/rails_4.1.gemfile) 18 Dec 2016 01:10PM UTC 0
99.49
Travis Job 542.8
9 542.9 (2.2.6, gemfiles/rails_4.2.gemfile) 18 Dec 2016 01:10PM UTC 0
99.49
Travis Job 542.9
10 542.10 (2.3.3, gemfiles/rails_4.0.gemfile) 18 Dec 2016 01:10PM UTC 0
99.5
Travis Job 542.10
11 542.11 (2.3.3, gemfiles/rails_4.1.gemfile) 18 Dec 2016 01:11PM UTC 0
99.5
Travis Job 542.11
12 542.12 (2.3.3, gemfiles/rails_4.2.gemfile) 18 Dec 2016 01:12PM UTC 0
99.5
Travis Job 542.12
Source Files on build 542
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #542
  • c136a974 on github
  • Prev Build on master (#539)
  • Next Build on master (#543)
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