[Ovmsdev] Time spent in ticker event handlers / new use for housekeeping task

Michael Balzer dexter at expeedo.de
Fri Mar 30 04:20:45 HKT 2018


Am 28.03.2018 um 20:50 schrieb Michael Balzer:
> My specific issue: I'm producing the notifications from my  ticker1 handler. I now found out a simple standard info notification needs already around 10 ms,
> and my battery status update (15 data messages) needs 60-70 ms. I thought these would run faster, not sure where the time is spent. I'm using the command
> notifications, nice to use but with quite some overhead of course.

Tests and optimization results on this:

1. Replaced NotifyCommand() calls by NotifyString(), with strings produced by a reused BufferedShell and calling the output methods directly instead of doing
the shell execution via microrl. That reduced the time to 40 ms.

2. Replaced the BufferedShells by StringWriters to also eliminate the memory overhead of the LogBuffer → std::string dump. I did that only for the memory, but
it reduced the time to 20 ms.

So there is quite some overhead involved in the standard command execution now.

I recommend using string notifications for all time critical data updates (i.e. battery cell blocks).

Regards,
Michael

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26





More information about the OvmsDev mailing list