mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
219c969d7b
Using absolute_msec requires a 64-bit division operation every time we calculate it, which gets expensive on 32-bit architectures. Instead, just use the lazy "monotime_coarse_get()" operation, and don't convert to milliseconds until we absolutely must. In this case, it seemed fine to use a full monotime_coarse_t rather than a truncated "stamp" as we did to solve this problem for the timerstamps in buf_t and packed_cell_t: There are vastly more cells and buffer chunks than there are channels, and using 16 bytes per channel in the worst case is not a big deal. There are still more millisecond operations here than strictly necessary; let's see any divisions show up in profiles.
5 lines
236 B
Plaintext
5 lines
236 B
Plaintext
o Minor features (performance, 32-bit):
|
|
- Improve performance on 32-bit systems by avoiding 64-bit division
|
|
to calculate the current timestamp in milliseconds for channel
|
|
padding computations. Implements ticket 24613.
|