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

pions / srtp / 27 / 1
41%
master: 41%

Build:
DEFAULT BRANCH: master
Ran 15 Feb 2019 06:48AM UTC
Files 10
Run time 1s
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

15 Feb 2019 06:45AM UTC coverage: 40.756% (+2.5%) from 38.256%
GO111MODULE=on

push

travis-ci

kixelated
Speed up EncryptRTP and make it append

new:
BenchmarkEncryptRTP-8          	  300000    5181 ns/op
BenchmarkEncryptRTPInPlace-8   	  300000    4480 ns/op

old:
BenchmarkEncryptRTP-8          	  200000    6378 ns/op
BenchmarkEncryptRTPInPlace-8   	  300000    4448 ns/op

The old code would:

1. `allocateIfMismatch` performs `bytes.Equal` to check if the dst/src
are the same. It's not needed, it's technically wrong, and it could
have been done faster with pointers anyway.
    ex: `&dst[0] == &src[0]`

2. `allocateIfMismatch` would always copy the payload, even if we're
just about to overwrite it with encrypted data.

3. `allocateIfMismatch` will make a byte slice of the size/cap of the
payload slice, but won't include extra room for the auth tag (10 bytes)
we're expecting to append. This means that we will always cause an
extra realloc/copy.

The unit test to check if the encryption was done in place was broken.
The ciphertext was being written to the dst, but then append was used
to write the auth tag. This causes a reallocation unless the dst is
allocated with 10 extra bytes of overhead. So encrypting in place would
often not work.

302 of 741 relevant lines covered (40.76%)

10.94 hits per line

Source Files on job 27.1 (GO111MODULE=on)
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 23
  • Travis Job 27.1
  • 1d1ace1e on github
  • Prev Job for GO111MODULE=on on master (#20.1)
  • Next Job for GO111MODULE=on on master (#37.1)
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