[haiku-bugs] Re: [Haiku] #1074: Identify and fix performance bottlenecks in our app_server

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Fri, 03 Jul 2020 18:17:41 -0000

#1074: Identify and fix performance bottlenecks in our app_server
---------------------------------+----------------------
  Reporter:  axeld               |      Owner:  jua
      Type:  enhancement         |     Status:  assigned
  Priority:  normal              |  Milestone:  R1
 Component:  Servers/app_server  |    Version:
Resolution:                      |   Keywords:
Blocked By:                      |   Blocking:
  Platform:  All                 |
---------------------------------+----------------------
Comment (by waddlesplash):

 system_time with int128 as it currently exists:
 {{{
 0000000000000010 <system_time>:
   10:   0f 31                   rdtsc
   12:   48 c1 e2 20             shl    $0x20,%rdx
   16:   48 09 d0                or     %rdx,%rax
   19:   48 f7 25 00 00 00 00    mulq   0x0(%rip)        # 20
 <system_time+0x10>
   20:   48 89 d0                mov    %rdx,%rax
   23:   c3                      retq
 }}}

 system_time with the logic as used in the bootloader involving uint64:
 {{{
 0000000000000010 <system_time>:
   10:   0f 31                   rdtsc
   12:   48 8b 0d 00 00 00 00    mov    0x0(%rip),%rcx        # 19
 <system_time+0x9>
   19:   48 c1 e2 20             shl    $0x20,%rdx
   1d:   48 09 d0                or     %rdx,%rax
   20:   89 c2                   mov    %eax,%edx
   22:   48 c1 e8 20             shr    $0x20,%rax
   26:   48 0f af d1             imul   %rcx,%rdx
   2a:   48 0f af c1             imul   %rcx,%rax
   2e:   48 c1 ea 20             shr    $0x20,%rdx
   32:   48 01 d0                add    %rdx,%rax
   35:   c3                      retq
 }}}

 So the uint128 version is actually fewer instructions, so unless imul is
 somehow significantly faster than mulq, the current version is faster.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/1074#comment:29>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: