Closed gjcairo closed 3 months ago
@swift-server-bot add to allowlist
@swift-server-bot test this please
I updated the allocations for nightly because they had been outdated for a while.
However this change doesn't affect any allocation tests: this is because allocation tests that call createStreamChannel
, call the createStreamChannel(promise:_:)
version (instead of createStreamChannel(_:)
), which is unaffected by this change. We could duplicate the allocation tests to use createStreamChannel(_:)
, or modify them to stop using the version with the promise, but I don't know if that's worth it/desired?
However this change doesn't affect any allocation tests: this is because allocation tests that call
createStreamChannel
, call thecreateStreamChannel(promise:_:)
version (instead ofcreateStreamChannel(_:)
), which is unaffected by this change. We could duplicate the allocation tests to usecreateStreamChannel(_:)
, or modify them to stop using the version with the promise, but I don't know if that's worth it/desired?
I think it's probably worth adding a version of the test which doesn't pass in the promise in a separate PR and verifying that we do save allocations here.
Motivation
When creating stream channels on the
InlineStreamMultiplexer
, we are currently performing aflatSubmit
on two different codepaths. This allocates two ELFs: one onsubmit
, and one onflatMap
. This is unnecessary, as we could do with just one allocation.Modifications
Create a single ELP and call
execute
on the EL instead of usingflatSubmit
.Result
Fewer allocations