mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-26 04:57:50 +00:00
Motivation: As noted in #105, I spotted that we were heap-allocating an array when parsing the frame header. That heap allocation isn't necessary, we can just write directly into an Int, which should save us some heap spray. Modifications: - Rewrote code to avoid heap allocating array and instead to use Int. - Elided some bounds checks by using an unsafe pointer, since I was already here and it saved about 1% performance in a hot loop. Result: Fewer heap allocations on the hot code path.