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

gwicke / restbase / 407
88%
master: 92%

Build:
Build:
LAST BUILD BRANCH: update_security_headers
DEFAULT BRANCH: master
Ran 21 Sep 2015 05:08AM UTC
Jobs 3
Files 15
Run time 1min
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
407

push

travis-ci

gwicke
Optimized request templating

This PR optimizes request templating further. The templating micro-benchmark
is now about 2-3 times faster, with a further 3x speedup to be had if we
hoisted the try/catch one level.

However, profiles don't really show this code (before or after) as that much
of a bottleneck.  There are some gains to be made here for RESTBase as a
whole, but they will primarily benefit otherwise cheap entry points, where
request rewriting is a bigger part of the overall request cost. For most HTML
requests, much more time is spent in the Cassandra driver.

To summarize, I wouldn't call this change necessarily super-critical for
overall RESTBase performance, at this point.

- Don't silently ignore when entire sub-trees are undefined. This is still
  supported where needed (via default(), for example), but making this the
  default strikes me as dangerous.
- More aggressively expand all simple templates inline by rewriting local
  references to the path prefix. This isn't perfect yet, but does work rather
  well.
- Rename Template.eval to Template.expand; `eval` is not popular with jshint.

- More robust scope rewriting (see inline notes)
- Possibly, reduce the try/catch tax by moving that up to the request wrapper,
  similar to the technique described by the bluebird authors:
  https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#2-unsupported-syntax)
- Reconsider if we really want to default to `method: spec.method ||
  request.method || 'get'`, or just `method: spec.method || 'get'`. This
  strikes me as a little bit too much magic, and it's good to call out
  potentially state-changing requests explicitly.
- Remove commented-out inline microbenchmarking code.

1512 of 1716 relevant lines covered (88.11%)

313.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 407.1 21 Sep 2015 05:08AM UTC 0
88.11
Travis Job 407.1
2 407.2 21 Sep 2015 05:09AM UTC 0
88.11
Travis Job 407.2
3 407.3 21 Sep 2015 05:09AM UTC 0
88.11
Travis Job 407.3
Source Files on build 407
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #407
  • ae981865 on github
  • Next Build on optimized_templating (#409)
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