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

pions / srtp / 27
41%

Build:
DEFAULT BRANCH: master
Ran 15 Feb 2019 06:48AM UTC
Jobs 1
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

pending completion
27

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

Jobs
ID Job ID Ran Files Coverage
1 27.1 (GO111MODULE=on) 15 Feb 2019 06:48AM UTC 0
40.76
Travis Job 27.1
Source Files on build 27
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #27
  • 1d1ace1e on github
  • Prev Build on master (#20)
  • Next Build on master (#37)
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