Opened 5 years ago

Last modified 3 years ago

#15509 new bug

Haiku thread switching speed is about 4 times slower than Windows 7 — at Version 1

Reported by: X512 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by X512)

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.

Change History (6)

by X512, 5 years ago

Attachment: ThreadTests.cpp added

Benchmark code for Haiku.

by X512, 5 years ago

Attachment: Main.c added

Benchmark code for Windows.

by X512, 5 years ago

Attachment: ThreadTests (1 core).prof added

Running "profiler -a ThreadTests" with only one core enabled.

by X512, 5 years ago

Attachment: ThreadTests (2 cores).prof added

Running "profiler -a ThreadTests" with all cores enabled. Unrelated threads removed.

by X512, 5 years ago

Attachment: Benchmark.png added

Benchmark bar graph.

comment:1 by X512, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.