If you post a fragment of your analysis code you can get some early suggestions on how this could be structured to minimize delays in responding to the serial messages.
I was curious, what is the longest acceptable delay between a serial message coming in and your sketch responding to it.