How fast can I trigger stuff to happen simultaneously?
cubegleamer
Posts: 21
Im tasked with speeding up the "startup" process on a system. This process includes reading a configuration from a text file, populating the appropriate structures with that info, setting up com ports based on the config, drawing the appropriate graphics on up to four touch panels based on the config, etc. There is a lot going on at startup. In the existing code, there is a timeline that is triggering these events, with time in between to space it out. In fact, the timeline triggers other timelines that carry out each process.
Everything works great now, they just want it to be faster, I just have no concept of how fast these events can be triggered and if there would be any negative to taking out all the space in between triggering functions.
For example, instead of--
case 1: someFunction
case 20: readFileFunction
case 70: readAnotherFilefunction
I want---
case 1: someFunction
case 2: readFileFunction
case 3: readAnotherFilefunction
I have tried it the way I want and nothing caught on fire, all info seemed to populate as expected and I was able to reduce the startup time by half. I guess Im just looking for a best practices, "watch out for --", or "you can do this or that to check processor load during those events"...What would dictate how fast these things can happen? Is it memory? processor speed?
Any help is appreciated. Thanks in advance
Everything works great now, they just want it to be faster, I just have no concept of how fast these events can be triggered and if there would be any negative to taking out all the space in between triggering functions.
For example, instead of--
case 1: someFunction
case 20: readFileFunction
case 70: readAnotherFilefunction
I want---
case 1: someFunction
case 2: readFileFunction
case 3: readAnotherFilefunction
I have tried it the way I want and nothing caught on fire, all info seemed to populate as expected and I was able to reduce the startup time by half. I guess Im just looking for a best practices, "watch out for --", or "you can do this or that to check processor load during those events"...What would dictate how fast these things can happen? Is it memory? processor speed?
Any help is appreciated. Thanks in advance
0
Comments
Paul
This is not meant as a snarky answer...
There are a lot of things going on under the hood that we cannot know or predict due to our lack of said info. (internal AMX secret spy stuff NS all that...)
I typically try to run stuff as fast as I can abd see if any parts fall off. If they do, I slow it down only after truly determining the root cause. For what it's worth I've never really seen an Internal programming thing outrun itself. Remember: it's a single threaded machine...
Like a_riot opines, I find that I'm waiting on another device.
As an aside, this is the fundamental difference between AMX and Cr3stron control systems:
- If you approach the processing limit of an NI it will slow down while chewing through what it needs to do.
- If you approach the processing limit of a Cr3stron 2 series it will spontaneously reboot.
In a processor intensive Cr3stron program you frequently need to delay operations to make sure you don't push the control system too hard.
Another thing to consider is why you need to keep restarting your system!
Even if you have new config parameters (hourly/daily/etc), Perhaps you could just reinitialize certain aspects of the system with some event without restarting everything.
While this is true and something I've done for a long while now, it's kinda wide of the discussion at hard. The system will need to be rebooted at some point and the OP was asking for info on how to speed up reboot.