[haiku-bugs] Re: [Haiku] #15509: Haiku thread switching speed is about 4 times slower than Windows 7

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 03 Dec 2019 16:29:38 -0000

#15509: Haiku thread switching speed is about 4 times slower than Windows 7
-----------------------------+----------------------------
   Reporter:  X512           |      Owner:  nobody
       Type:  bug            |     Status:  new
   Priority:  normal         |  Milestone:  Unscheduled
  Component:  System/Kernel  |    Version:  R1/Development
 Resolution:                 |   Keywords:
 Blocked By:                 |   Blocking:
Has a Patch:  0              |   Platform:  All
-----------------------------+----------------------------
Description changed by X512:

Old description:

This is Haiku hrev53608 32 bit gcc2hybrid, real hardware.

I made some benchmarks for Haiku and Windows. Benchmark using 2 threads:
main thread and working thread. In each step main thread send request to
worker thread and wait for reply of working thread. Working thread does
simple processing and send reply. Benchmark result is number of steps per
second. According ''profiler'' command, about 90% of execution is inside
''switch_sem_etc'' and ''release_sem_etc'' of kernel_x86. This functions
proably should be optimized.

Also single core mode is about 3 times more efficient than multi core,
but this behavior is similar to Windows.

I think that fast thread switching speed is required for Haiku because
Haiku is actively using threads, for example thread pair in application
and app_server for each window.

New description:

 This is Haiku hrev53608 32 bit gcc2hybrid, real hardware.

 I made some benchmarks for Haiku and Windows. Benchmark using 2 threads:
 main thread and working thread. In each step main thread send request to
 worker thread and wait for reply of working thread. Working thread does
 simple processing and send reply. Benchmark result is number of steps per
 second. According ''profiler'' command, about 90% of execution is inside
 ''switch_sem_etc'' and ''release_sem_etc'' of kernel_x86. This functions
 probably should be optimized.

 Also single core mode is about 3 times more efficient than multi core, but
 this behavior is similar to Windows.

 I think that fast thread switching speed is required for Haiku because
 Haiku is actively using threads, for example thread pair in application
 and app_server for each window.

--
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15509#comment:1>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: