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

TykTechnologies / tyk / 5376 / 2

Build:
DEFAULT BRANCH: master
Ran 09 Aug 2018 03:07PM UTC
Files 102
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

09 Aug 2018 03:00PM UTC coverage: 60.147% (+0.7%) from 59.438%
LATEST_GO=true

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)

9380 of 15595 relevant lines covered (60.15%)

0.67 hits per line

Source Files on job 5376.2 (LATEST_GO=true)
  • Tree
  • List 0
  • Changed 9
  • Source Changed 9
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 4906
  • Travis Job 5376.2
  • e3373705 on github
  • Prev Job for LATEST_GO=true on master (#5375.1)
  • Next Job for LATEST_GO=true on master (#5377.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

© 2025 Coveralls, Inc