Ticket #29 (new feature)

Opened 4 years ago

Last modified 3 years ago

Thread performance/runtime assessment

Reported by: tim Owned by: AllemaniACs
Priority: major Milestone:
Component: Fawkes Version:
Keywords: Benchmarking, Threading Cc:
Git Branch:

Description

A performance assessment system is needed to allow for centralized collection of information that describe the overall performance of the system.

The idea is to use the central ThreadCollector (which is implemented by the FawkesThreadManager) to get timing information of all threads. This information can then be represented for example by a Gantt chart. This should give clear information on the overall performance allowing to identify dead spots in the code and crowded regions (too many threads active at the same time).

An idea is to add functionality to a thread to collect this information by itself in a memory region it shares with the thread collector. The thread collector can then access this memory region just from time to time to have minimum interference of the measuring and the normal loops of the threads. If we assume to collect only the times for the begin and end of a Thread::loop() run 16 bytes are required per loop run.
If we assume that for a whole performance assessment we want to be able to record at least 20 minutes and we further assume that the thread runs at 100Hz this makes 20 * 60 * 100 * 16 = 1920000 Bytes ~ 1.84 MB. If we further assume that we want to assess 50 threads at the same time (currently if three vision processes run we have about 15 threads) we need about 100 MB of memory for collecting the information. Given that we have 2 GB and hardly used more than 10 MB this gives plenty of room.
The structures are likely to change to collect more information but additionally most threads will only run at 30 Hz and thus the rough calculation should still hold.

Using a memory region and not neither calling a handler in the a performance assessment class to collect the information nor writing to a file should give minimum influence of the measurement on the actual software behavior.

Change History

Changed 3 years ago by tim

The ttmainloop plugin (trunk/src/plugins/ttmainloop) can be used to track time per hook to a log file. Will commit a simple gnuplot script that creates a nice chart of the data. My thesis contains a short analysis of the current run-time performance on the Nao and MSL robots. Although not as detailed (it's per hook, not per thread) as desired, it already gives a good clue what's going on, especially considering that most of the time there is only a single thread per hook (with vision plugins on the MSL robot being the exception at the moment).

Leaving this bug open as we want to have per-thread assessment at some point.

Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Subscriber, Participant

  • Fawkes Trac List(Always)
  • Tim Niemueller(Reporter, Participant)