go-astits icon indicating copy to clipboard operation
go-astits copied to clipboard

Major optimization 6x faster

Open Curid opened this issue 2 years ago • 1 comments

RTP to MPEGTS benchmark.
Before: 33556858 ns/op  4763101 B/op
After:   5169437 ns/op  3881852 B/op

I wrote this a few months ago and have been using it in production for weeks on end without issues. I no longer have a use for mpegts library, so I figured you could have it. There may be some small breaking changes, but all tests pass.

Changes:

  • Use icza/bitio for bit manipulation
  • Dynamic CRC32 calculation
  • Don't use fmt.Sprintf when parsing timestamp

Curid avatar Aug 10 '22 17:08 Curid

Thanks! Could you create a PR with the optimizations only and not the reformatting/linting changes ?

asticode avatar Aug 11 '22 06:08 asticode