Opened 5 months ago

Closed 5 months ago

#25927 closed defect (implemented)

Remove the need for gettimeofday_cached(); use monotonic time in ewma code

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 034-roadmap-subtask, 034-triage-20180328, 034-included-20180328
Cc: Actual Points:
Parent ID: #25375 Points:
Reviewer: dgoulet Sponsor: Sponsor8

Description (last modified by nickm)

approx_time() should be done the way we currently do gettimeofday_cached(). gettimeofday_cached() should be removed entirely.

This will improve our performance a little, and improve our code a lot.

edited: this ticket is now only about gettimeofday_cached(); approx_time() will take a different ticket.

Child Tickets

Change History (7)

comment:1 Changed 5 months ago by nickm

Description: modified (diff)
Summary: Refactor approx_time(); remove the need for gettimeofday_cached().Remove the need for gettimeofday_cached(); use monotonic time in ewma code

comment:2 Changed 5 months ago by nickm

Status: assignedneeds_review

See branch eliminate_gettimeofday_cached in my public repository and on github.

comment:4 Changed 5 months ago by dgoulet

Reviewer: dgoulet

comment:5 Changed 5 months ago by dgoulet

Status: needs_reviewmerge_ready

Looks good to me. Only one comment about the added random value of the tick number which is the only difference I could see on the EWMA side for which I believe it is a good addition!

However, I can't test the compat functions for the diff_msec() so I would rely on travis and Jenkins to pick up any issues on other platforms if we do test them in the CI.

Test passes.

comment:6 Changed 5 months ago by nickm

Commented on the randomness; merging to master. Will keep an eye on CI in case it breaks.

comment:7 Changed 5 months ago by nickm

Resolution: implemented
Status: merge_readyclosed
Note: See TracTickets for help on using tickets.