7 ms·
Excellent! I think that's exactly what I was looking for! Thank you so much for going into detail on that, it helped immensely. I have a similar problem (thoug
by lambda_obrien 6y ago
Excellent! I think that's exactly what I was looking for! Thank you so much for going into detail on that, it helped immensely.
I have a similar problem (though can't talk too many details) with discrete "ticks" and with a constrained CPU (a peak constraint, I have plenty of aggregate CPU power over time). I think I could fit some simple version of the symbolic module optimizer algorithm like you describe into the unused CPU time to optimize the spiky algorithm before I receive events (the events are spread apart pretty good) to return more accurate and timelier results when they do come. I am using a Haskell-like language for this that compiles to a binary format with a similar graph reduction scheme for the compiler as you describe for the symbolic reducer, so it should be very simple for me to compose the modules as you describe.
The problem I have now is that when I need to calculate something that's very-high-priority (some events have hard deadlines), I would like to have a more optimized algorithm, but I don't have time to optimize it on the fly from the information I know (my knowledge is continuous, only the events are discrete), so I have to use less-accurate results or sometimes I don't have an answer so I just return a "no answer" response and the process fails. I tried using some crappy default values, but it would still fail most of the time.
I think about my problem like a process which has a target and my answer is the "direction to aim at" for the process and so if I return a bad result to this process it'll just miss the target, so I just say "sorry, can't aim right now, wait 1 more tick" and I then am able to start a calculation for the next round before the process even asks for it and it finishes easily this time, since my events have a low frequency. Using an optimal algorithm (which I can get from a symbolic reduction: that's how I did it--by hand--in the first place to get my current algos) will always return the answer in time, based on my models and experiments.