Opened 7 months ago

Closed 7 months ago

Last modified 6 months ago

#28853 closed enhancement (implemented)

parse_short_policy() could be faster

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.4.0.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Normal Keywords: startup performance
Cc: Actual Points: .3
Parent ID: #28481 Points:
Reviewer: dgoulet Sponsor: Sponsor8-can


The main loop of parse_short_policy() is needlessly convoluted, and parses the same things more than once. It could be simplified greatly.

Child Tickets

Change History (6)

comment:1 Changed 7 months ago by nickm

My branch ticket28853 makes parse_short_policy about 84% faster, saving about 4% of total startup time for me. PR at

comment:2 Changed 7 months ago by teor

Status: assignedneeds_review

comment:3 Changed 7 months ago by dgoulet

Reviewer: dgoulet

comment:4 Changed 7 months ago by dgoulet

Status: needs_reviewmerge_ready

Code lgtm. For sake of performance, that code structure could make sense and seems your measurement shows that it helps speed it up but oh my oh my that is not an easy function to follow :).


comment:5 Changed 7 months ago by nickm

Resolution: implemented
Status: merge_readyclosed

Merged to master. Sorry for the complexity. :/

comment:6 Changed 6 months ago by nickm

Actual Points: .3
Note: See TracTickets for help on using tickets.