This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

How to shift buffers?
#2
Sorry, I am a bit in a hurry right now and did not have a chance to thorowly look into your example, but I have a few pointers that I would like to drop quickly. I hope they are not beside the topic:
  • The current editor is outdated compared to the current file format of phyphox. Its output works, but it does not offer all features that are available now. We are about to release a new editor, but we are a bit stuck in a testing-fix-testing-loop. As soon as there are not too many bugs found by our weekly test with students the new version will be made available as a public beta. Until then, you should probably resort to editing the XML file directly if you want to optimize in such details.
  • You are right that most operations like subrange are quite expensive if you have a large dataset. The way our flexible file format is implemented requires a full copy of the range that is copied by the subrange module as well as the append module or any other module as phyphox does not look ahead to check if the inputs are still used later (this is not apparent from how the old editor displays the logic). This will always be true for operations that increase the buffer size, but I could look into at least optimizing subrange in case that the clear falg is set on the input.
  • Be careful about buffers that are directly connected to graphs. Doing anything to them that is more complicated than just appending new values is rather expensive as they retain a copy of their data that has been prepared for OpenGL and they will have to rebuild that data if anything more complicated happens.
  • The most efficient way to shift values - at least if what you need is a fixed number of values - is setting a fixed buffer size, which will have a shifting effect. If you need control over new data, you could write the sensor data into a separate buffer, process new data and also copy it into a buffer with fixed size. This should be more efficient as only the new data is copied while the larger set of old data is handled by the fixed-size buffer.
  • There are a few new features that the old editor did not yet support, which might be interesting for your case: The split module helps if you want to process new incoming data, but need to keep some of it around for the next cycle. The requireFill attribute of the analysis block (and related attributes) helps to only run the analysis process if you have new data.
  • And on the subject of synchronizing sensors: Did you see the rateStrategy attribute (another one that is not in the old editor)? This allows to force a specific rate of the sensor - unfortunately each strategy has its downside as we cannot force the device's sensor to actually run at a specific rate.

Now, that reply became longer than expected, so I hope there is something helpful in there Smile
Reply


Messages In This Thread
How to shift buffers? - by Trikes - 06-24-2024, 09:14 AM
RE: How to shift buffers? - by Sebastian Staacks - 06-24-2024, 09:47 AM
RE: How to shift buffers? - by Trikes - 06-25-2024, 07:59 AM
RE: How to shift buffers? - by Sebastian Staacks - 06-25-2024, 09:16 AM
RE: How to shift buffers? - by Trikes - 06-27-2024, 08:54 AM
RE: How to shift buffers? - by Jens Noriʇzsɔɥ - 06-27-2024, 10:10 AM
RE: How to shift buffers? - by Sebastian Staacks - 06-28-2024, 12:53 PM
RE: How to shift buffers? - by Trikes - 06-29-2024, 09:28 AM
RE: How to shift buffers? - by Jens Noriʇzsɔɥ - 06-29-2024, 02:41 PM
RE: How to shift buffers? - by Trikes - 06-29-2024, 07:40 PM
RE: How to shift buffers? - by Sebastian Staacks - 06-30-2024, 02:55 PM
RE: How to shift buffers? - by Jens Noriʇzsɔɥ - 06-30-2024, 04:25 PM

Forum Jump: