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

meineerde / rackstash / 147
99%

Build:
DEFAULT BRANCH: master
Ran 22 Sep 2017 11:19PM UTC
Jobs 1
Files 39
Run time 4s
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
147

push

travis-ci

meineerde
Optimize the TruncateMessage filter with Proc selectors

If we have a proc, we can pass it directly to the `select!` method
instead of having to manually call the selector. This gives a
significant speedup for the common case of simple selectors:

    require 'benchmark/ips'
    Benchmark.ips do |x|
      selector = ->(value) { value < 500 }
      values = (1..1000).to_a

      x.report("call") { values.select { |v| selector.call(v) } }
      x.report("block") { values.select(&selector) }

      x.compare!
    end

    Warming up --------------------------------------
                    call   663.000  i/100ms
                   block     1.598k i/100ms
    Calculating -------------------------------------
                    call      6.897k (± 4.8%) i/s -     34.476k in   5.011617s
                   block     16.561k (± 4.2%) i/s -     83.096k in   5.026999s

    Comparison:
                   block:    16560.7 i/s
                    call:     6896.5 i/s - 2.40x  slower

1273 of 1276 relevant lines covered (99.76%)

20.69 hits per line

Jobs
ID Job ID Ran Files Coverage
7 147.7 (2.3.5, COVERAGE=1) 22 Sep 2017 11:19PM UTC 0
99.76
Travis Job 147.7
Source Files on build 147
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #147
  • f8d8c040 on github
  • Prev Build on master (#146)
  • Next Build on master (#148)
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