Opened 4 years ago

Last modified 2 years ago

#16811 new enhancement

Mark TestingTorNetwork PREDICT_UNLIKELY

Reported by: teor Owned by:
Priority: Very Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Trivial Keywords: lorax, easy, needs-analysis
Cc: Actual Points:
Parent ID: Points: small
Reviewer: Sponsor: SponsorS-can

Description

I'd like to see every instance of:
if (options->TestingTorNetwork) { (or similarly, get_options()->)
transformed to:
if (PREDICT_UNLIKELY(options->TestingTorNetwork)) {

This should give us a slight performance boost in relays and authorities, at the cost of a slight slowdown due to missed branch predictions in test networks.

This would be best done using a coccinelle, perl, or sed script.

Child Tickets

Change History (6)

comment:1 Changed 4 years ago by nickm

Before we go ahead and do it, do we have any evidence that this branch is getting mis-predicted in any critical paths?

(Also, better to have it be a macro or something IMO if we do decide to take this route.)

comment:2 Changed 4 years ago by nickm

Milestone: Tor: 0.2.8.x-finalTor: unspecified

comment:3 Changed 4 years ago by nickm

Keywords: SponsorS removed
Sponsor: SponsorS

Bulk-replace SponsorS keyword with SponsorS sponsor field in Tor component.

comment:4 Changed 4 years ago by nickm

Points: small
Severity: Normal

comment:5 Changed 4 years ago by isabela

Sponsor: SponsorSSponsorS-can

comment:6 Changed 2 years ago by nickm

Keywords: needs-analysis added
Priority: MediumVery Low
Severity: NormalTrivial
Note: See TracTickets for help on using tickets.