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

gwicke / restbase / 407 / 3
88%
master: 92%

Build:
Build:
LAST BUILD BRANCH: update_security_headers
DEFAULT BRANCH: master
Ran 21 Sep 2015 05:09AM UTC
Files 15
Run time 0s
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

21 Sep 2015 05:06AM UTC coverage: 88.112%. First build
407.3

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%)

104.66 hits per line

Source Files on job 407.3
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 407
  • Travis Job 407.3
  • ae981865 on github
  • Next Job for on optimized_templating (#409.2)
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