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

TykTechnologies / tyk / 5376

Build:
DEFAULT BRANCH: master
Ran 09 Aug 2018 03:07PM UTC
Jobs 2
Files 102
Run time 3min
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
5376

push

travis-ci

buger
Profile benchmark copy request response (#1778)

added changes for https://github.com/TykTechnologies/tyk/issues/1668

these are pretty low level changes so I think we need to test it carefully.

changes include:
- don't do copy of `Request` or `Response` as it is shallow one anyways and we have pointers to the same data
- convert `Request.Body` to `nopCloser` only once and then use the same instance of `Request` passed everywhere
- convert `Response.Body` to `nopCloser` only once and then use the same instance of `Response` passed everywhere
- `nopCloser` in addition to no-op Close has nested `ReadSeeker` inside and rewinds position in buffer every time body was read up to EOF, or `Close` was called, or outer logic tried to convert to `nopCloser` while it was already `nopCloser`
- `nopCloser` doesn't create new buffer "descriptor" struct every time as it was before as it is safe to use the same `Body` for reading now (unless we read some request or response body in parallel, which is not the case)

benchcmp of BenchmarkCopyRequestResponse vs master:
```
benchmark                          old ns/op     new ns/op     delta
BenchmarkCopyRequestResponse-8     15244         9930          -34.86%

benchmark                          old allocs     new allocs     delta
BenchmarkCopyRequestResponse-8     76             18             -76.32%

benchmark                          old bytes     new bytes     delta
BenchmarkCopyRequestResponse-8     35585         29120         -18.17%
```

if we run all benchmarks we see that performance gain is not super big but still looks good (under heavy traffic less allocation will pay off imho):
benchcmp vs master:
```
benchmark                                                                                                   old ns/op     new ns/op     delta
BenchmarkURLReplacer-8                                                                                      1912          1900          -0.63... (continued)

9373 of 15585 relevant lines covered (60.14%)

1.33 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5376.1 (LATEST_GO=true) 09 Aug 2018 03:07PM UTC 0
59.53
Travis Job 5376.1
2 5376.2 (LATEST_GO=true) 09 Aug 2018 03:07PM UTC 0
60.15
Travis Job 5376.2
Source Files on build 5376
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5376
  • e3373705 on github
  • Prev Build on master (#5375)
  • Next Build on master (#5377)
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