immersivecognition / unity-experiment-framework

UXF - Framework for creating human behaviour experiments in Unity
https://immersivecognition.github.io/unity-experiment-framework/
MIT License
214 stars 41 forks source link

Replacing `Thread` with `Task` in `FileSaver` #143

Closed ahmed-shariff closed 1 year ago

ahmed-shariff commented 2 years ago

This PR replaces the use of Thread with Task in FileSaver. I had had a large number of trackers (>50) in one of my scenes and the I/O was a performance bottleneck, which is a big problem for me as it impacts my time calculations. Using tasks allows to use more threads and also is a cleaner interface (and also recommended).

jackbrookes commented 2 years ago

Hi, thanks for this! I'd need to do some testing on this. Have you tried running the existing Unit Tests with the Unity Test Runner to see if they pass? Can you think of any other tests to ensure this functionality is working as expected?

ahmed-shariff commented 2 years ago

The test runner passes all the tests. I'll also go over the tests and see what I can add to it.

ahmed-shariff commented 1 year ago

I take back what I had said earlier, while there are gains in some place, it seems to be clogging the GC (I think). I'll try out a few other things and see how it pans out. Put in another PR if that works out.