View unanswered posts | View active topics It is currently Wed Oct 17, 2018 8:20 am



Reply to topic  [ 4 posts ] 
Future Live Mode Semantics 
Author Message
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 15185
Location: Home sweet home!
I've been thinking about live mode (in the last 15 seconds or so) and realised that if we allow it to eat and eat memory, then it'll interrupt the flow of the data across the screen each time it increases the array size. IE, that's unacceptable. What this means is that we have to let the user set a buffer size to use (N samples long) and treat it as a circular buffer. Ben, when you get a chance to think about that, do, and let me know what is likely to come apart at the seams if/when we enabled that mode of operation.

The other thing that that means is that after N samples we'll be throwing away data, so we'll also need to write data out to a file as we go using a buffered writer that writes fairly regularly to keep things smooth, but not too regularly or it'll eat too much CPU.

This message brought to you by a console window that said 2600 records loaded in 37000ms or, 15ms per record, or 65Hz max sample rate before host CPU saturation (with my current other loads). This is fairly worst case, the machine is being a dog at the moment, however is slower than FreeEMS pumps them out, so needs to be improved, I guess. There is an API that needs adding in your drawing classes such that we can improve the efficiency of the data classes. The change will be one that enables you to extract the data natively and display it without significant processing. At the same time I'll then be able to populate it natively and save a shit load of CPU time in the process, not to mention a factor of 8 memory in many cases which will also save time doing array resizes during load, should they be necessary. It's not a priority at all, and I'd like to be heavily involved in that change, but keep it in mind.

Fred.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Sun Mar 11, 2012 7:04 pm
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Wed Jul 09, 2008 3:15 pm
Posts: 360
Off the top of my head, the size of the circular buffer simply needs to be set to the amount of data points that can currently fit in the display window (already calculated in code). This could dynamically change if someone zooms?
As data falls off the left side of the display it gets written to disc or put in another buffer that waits to be written.

Maybe we pick a certain buffer size and use as many of those (plus one) as it takes to span the entire display and write the oldest buffer to disc as it falls out of use? That keeps writes to disc a constant in size and frequency.

As for the rest of the issues with implementing this, there will be a few, but I can't exactly pin down what they will be right now.

_________________
BenFenner's 1994 Black SE-R
BenFenner's 2000 Black M-Coupe


Wed Nov 14, 2012 2:52 pm
Profile
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 15185
Location: Home sweet home!
Good thoughts, Ben!

How about this:

Live mode: Minimal/dynamic/fixed/chosen buffer that just keeps enough, no more.
Dead mode: The usual.

The writing to disk is already handled in my plugin (not sure why I wrote that), and can be handled by a CSV dump if a megashit plugin was ever added to handle live mode.

Fred.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Wed Nov 14, 2012 2:57 pm
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Wed Jul 09, 2008 3:15 pm
Posts: 360
I have no objections.

_________________
BenFenner's 1994 Black SE-R
BenFenner's 2000 Black M-Coupe


Wed Nov 14, 2012 4:12 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF. ColorizeIt.