HomeFreeBSD

time(3): Optimize tvtohz() function.

Description

time(3): Optimize tvtohz() function.

List of changes:

  • Use integer multiplication instead of long multiplication, because the result is an integer.
  • Remove multiple if-statements and predict new if-statements.
  • Rename local variable name, "ticks" into "retval" to avoid shadowing

the system "ticks" global variable.

Reviewed by: kib@ and imp@
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D36859

Details

Provenance
hselaskyAuthored on Oct 20 2022, 4:49 PM
Differential Revision
D36859: time(3): Optimize tvtohz() function.
Parents
rGee29897fc3d6: time(3): Declare the minimum and maximum hz values supported.
Branches
Unknown
Tags
Unknown