Development:Software:performance

From rusEfi
Jump to: navigation, search

Event handling

Console command prints the state of internal performance counters: performanceinfo

histogram all callbacks *1671 1669 4946 17312 20669 *
histogram main callback *545 517 536 12907 13993 *


This means that average total trigger event time was 4946 ticks but maximum was 20669.


See also: http://rusefi.com/docs/html/histogram_8c.html
See also: https://sourceforge.net/p/rusefi/tickets/35/

Signal output scheduling

Previous failed implementation: 100% software signal control. one OS thread per output channel + sleep. Precision was too log.


Current implementation: hybrid signal control: one hardware timer scheduling all output channels using a tree data structure.
See also http://rusefi.com/forum/viewtopic.php?f=5&t=2
See also http://sourceforge.net/p/rusefi/tickets/24/

Forum threads

http://rusefi.com/forum/viewtopic.php?f=5&t=517 https://sourceforge.net/p/rusefi/tickets/181/

hardware TIMers

stm32f4 has something like 14 times - some are more, some are less advanced and capable

Currently we are using:
4 timers for input capture (cam + crank + 2 extra input for digital sniffer)
1 timer to schedule 'fast' ADC conversion (that's only the MAP sensor, todo: continues conversion mode?)
1 timer to schedule 'slow' ADC conversion (that's the rest of the timers, todo: schedule ADC by a software timer?)
1 timer for 'single timer event scheduling (Work-in-progress)

testperf report

Here is output of perftest 200000 (4/30/2014)

2014-04-14 17_05: EngineState: Finished 20000 iterations of getBaseFuel in 215ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of 'chTimeNow()' in 11ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of 'chTimeNow()' with chSysLock in 166ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of 'currentTimeMillis' in 17ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of int64_t summation in 16ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of int64_t multiplication in 23ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of empty loop in 5ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of int summation in 7ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of int division in 6ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of long summation in 6ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of long division in 5ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of float summation in 10ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of float division in 47ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of double summation in 283ms
2014-04-14 17_05: EngineState: Finished 200000 iterations of double division in 1151ms


07/05/2014:

2014-07-05 16_43: EngineState: Finished 20000 iterations of getBaseFuel in 187ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of 'chTimeNow()' in 37ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of 'chTimeNow()' with chSysLock in 132ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of 'currentTimeMillis' in 58ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of int64_t summation in 62ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of int64_t multiplication in 73ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of empty loop in 23ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of int summation in 32ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of int division in 44ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of long summation in 32ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of long division in 45ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of float summation in 32ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of float division in 65ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of float log in 415ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of double summation in 192ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of double division in 692ms
2014-07-05 16_43: EngineState: Finished 200000 iterations of double log in 552ms


05/19/2017 status:




TODO

Not use hardware times for ADC