Open Bug 1853685 Opened 10 months ago Updated 10 months ago

Inefficient argument passing in HttpTransactionParent::RecvOnStartRequest

Categories

(Core :: Networking: HTTP, enhancement, P2)

enhancement

Tracking

()

People

(Reporter: jesup, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [good-first-bug][necko-triaged])

From Coverity

** CID 1545017: Performance inefficiencies (PASS_BY_VALUE)
/netwerk/protocol/http/HttpTransactionParent.cpp: 420 in mozilla::net::HttpTransactionParent::RecvOnStartRequest(const nsresult &, const mozilla::Maybe<mozilla::net::nsHttpResponseHead> &, nsITransportSecurityInfo *, const bool &, const mozilla::net::TimingStructArgs &, const int &, nsTArray<unsigned char> &&, const mozilla::Maybe<nsTString<char>> &, const bool &, const bool &, const unsigned int &, const bool &, const nsIRequest::TRRMode &, const nsITRRSkipReason::value &, const unsigned int &)::[lambda() (instance 1)]::operator ()()()


*** CID 1545017: Performance inefficiencies (PASS_BY_VALUE)
/netwerk/protocol/http/HttpTransactionParent.cpp: 420 in mozilla::net::HttpTransactionParent::RecvOnStartRequest(const nsresult &, const mozilla::Maybe<mozilla::net::nsHttpResponseHead> &, nsITransportSecurityInfo *, const bool &, const mozilla::net::TimingStructArgs &, const int &, nsTArray<unsigned char> &&, const mozilla::Maybe<nsTString<char>> &, const bool &, const bool &, const unsigned int &, const bool &, const nsIRequest::TRRMode &, const nsITRRSkipReason::value &, const unsigned int &)::[lambda() (instance 1)]::operator ()()()
414 const bool& aDataToChildProcess, const bool& aRestarted,
415 const uint32_t& aHTTPSSVCReceivedStage, const bool& aSupportsHttp3,
416 const nsIRequest::TRRMode& aMode, const TRRSkippedReason& aTrrSkipReason,
417 const uint32_t& aCaps) {
418 mEventQ->RunOrEnqueue(new NeckoTargetChannelFunctionEvent(
419 this,

CID 1545017:  Performance inefficiencies  (PASS_BY_VALUE)
Capturing variable "aResponseHead" of type "mozilla::Maybe<mozilla::net::nsHttpResponseHead> const" (size 192 bytes) by value, which exceeds the low threshold of 128 bytes.

420 self = UnsafePtr<HttpTransactionParent>(this), aStatus, aResponseHead,
421 securityInfo = nsCOMPtr{aSecurityInfo}, aProxyConnectFailed, aTimings,
422 aProxyConnectResponseCode,
423 aDataForSniffer = CopyableTArray{std::move(aDataForSniffer)},
424 aAltSvcUsed, aDataToChildProcess, aRestarted, aHTTPSSVCReceivedStage,
425 aSupportsHttp3, aMode, aTrrSkipReason, aCaps
mutable {

Should be easy to fix. Perhaps Dylan?

Whiteboard: [good-first-bug]
Severity: -- → S3
Priority: -- → P2
Whiteboard: [good-first-bug] → [good-first-bug][necko-triaged]
You need to log in before you can comment on or make changes to this bug.