Please sign in to comment.
Avoid unnecessary allocation by way of tuple conversion. (#994)
Motivation: Due to https://bugs.swift.org/browse/SR-10614, assigning an array containing a tuple type to a variable that expects an array containing a different-but-compatible tuple type will cause an allocation and copy of that array storage. In some cases this is necessary, but we were doing it in the HTTPHeaders constructors, which meant that the swift-nio-http2 code was hitting a hilariously over the top number of allocations. Modifications: - Change the internal storage type of HTTPHeaders to match the public constructor. Result: Fewer allocations when constructing HTTPHeaders
- Loading branch information...
Showing with 20 additions and 5 deletions.
- +1 −1 IntegrationTests/tests_01_http/test_07_headers_work.sh
- +1 −1 IntegrationTests/tests_04_performance/test_01_allocation_counts_for_http1.sh
- +11 −0 ...ationTests/tests_04_performance/test_01_resources/template/Sources/SwiftBootstrap/SwiftMain.swift
- +3 −3 Sources/NIOHTTP1/HTTPTypes.swift
- +2 −0 docker/docker-compose.1604.51.yaml
- +2 −0 docker/docker-compose.1804.50.yaml