Opened 2 months ago

Closed 2 months ago

Last modified 6 weeks 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: 0.3.4.9
Severity: Normal Keywords: startup performance
Cc: Actual Points: .3
Parent ID: #28481 Points:
Reviewer: dgoulet Sponsor: Sponsor8-can

Description

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 2 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 https://github.com/torproject/tor/pull/592

comment:2 Changed 2 months ago by teor

Status: assignedneeds_review

comment:3 Changed 2 months ago by dgoulet

Reviewer: dgoulet

comment:4 Changed 2 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 :).

Ack.

comment:5 Changed 2 months ago by nickm

Resolution: implemented
Status: merge_readyclosed

Merged to master. Sorry for the complexity. :/

comment:6 Changed 6 weeks ago by nickm

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