Async load from cache

Hi,
is is possible to load from cache async? I have a pretty small graph but still when it loads from cache I get 3mb GC alloc. I am making a small mobile game and this gives a big fps drop. Profiler shows that this is mostly IO operations and allocating memory. It is possible to move it to background thread?

Thank you

Hi

I think you should be able to do it by simply starting a thread and calling the function from there.
However you may want to call AstarPath.PausePathfinding outside the thread to make sure there are no multithreading issues.

var graphLock = active.PausePathfinding();
new Thread {
    load graph here
    graphLock.Release();
}

Thanks a lot for quick response.

For now looks like it works. Will do more testing later.

1 Like