Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh loading optimizations #3488

Open
akleshchev opened this issue Jan 29, 2025 · 1 comment
Open

Mesh loading optimizations #3488

akleshchev opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request triage Flags issues that need to be triaged

Comments

@akleshchev
Copy link
Contributor

akleshchev commented Jan 29, 2025

Mesh thread is very busy on a region of moderate size on AMD Ryzen 7 3800X
Image

  1. Fix disk usage
    Mesh thread reads from disk to check if file in cashe has data and reads whole lod segment in one go only then requests data from network. Disk operations are expensive so it's better to minimize them and only read disk when it's has something to read. Like when we are reading header, get information about presense of lods too.

  2. Threading
    Thread appears to be busy all the time, which should be affecting speed of processing meshes negatively. A lot of expensive operations, like meshes' cacheOptimize don't need to happen here

  3. Doublecheck mutexes

@akleshchev akleshchev added enhancement New feature or request triage Flags issues that need to be triaged labels Jan 29, 2025
@akleshchev akleshchev self-assigned this Jan 30, 2025
akleshchev added a commit that referenced this issue Jan 30, 2025
preparation for further work
akleshchev added a commit that referenced this issue Jan 30, 2025
LLMeshHeaderHandler preallocates file with empty data, there is no point
reading large empty sections so write presense flags at the start of the
file
akleshchev added a commit that referenced this issue Jan 30, 2025
LLMeshHeaderHandler preallocates file with empty data, there is no point
reading large empty sections so write presense flags at the start of the
file
akleshchev added a commit that referenced this issue Jan 30, 2025
LLMeshHeaderHandler preallocates file with empty data, there is no point
reading large empty sections so write presense flags at the start of the
file
akleshchev added a commit that referenced this issue Jan 30, 2025
LLMeshHeaderHandler preallocates file with empty data, there is no point
reading large empty sections so write presense flags at the start of the
file
akleshchev added a commit that referenced this issue Jan 30, 2025
preparation for further work
akleshchev added a commit that referenced this issue Jan 30, 2025
LLMeshHeaderHandler preallocates file with empty data, there is no point
reading large empty sections so write presense flags at the start of the
file
akleshchev added a commit that referenced this issue Jan 31, 2025
akleshchev added a commit that referenced this issue Jan 31, 2025
preparation for further work
akleshchev added a commit that referenced this issue Jan 31, 2025
LLMeshHeaderHandler preallocates file with empty data, there is no point
reading large empty sections so write presense flags at the start of the
file
akleshchev added a commit that referenced this issue Jan 31, 2025
akleshchev added a commit that referenced this issue Jan 31, 2025
Request was sent and handle is valid, save it
akleshchev added a commit that referenced this issue Jan 31, 2025
Tracy shows that thread waits a lot on mutexes.
Split in and out mutexes, so that new work can be scheduled by main
thread without blocking handling
@akleshchev
Copy link
Contributor Author

Performance wise just resolving some mutexes and fixing extra disk reads turned to be surprisingly effective. "wait" is the thread having free time instead of a solid line of 'mesh_thread_loop'.
I do not see any obvious issues inworld, so it's time to test if avatar loading is any faster now that thread can keep up. If it helps, will improve threading.

Image

akleshchev added a commit that referenced this issue Feb 3, 2025
Tracy shows that thread waits a lot on mutexes.
Split in and out mutexes, so that new work can be scheduled by main
thread without blocking handling
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
Skin info parsing is expensive, offload to thread pool
akleshchev added a commit that referenced this issue Feb 4, 2025
Skin info parsing is expensive, offload to thread pool
akleshchev added a commit that referenced this issue Feb 4, 2025
Skin info parsing is expensive, offload to thread pool
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
akleshchev added a commit that referenced this issue Feb 4, 2025
Skin info parsing is expensive, offload to thread pool
akleshchev added a commit that referenced this issue Feb 6, 2025
akleshchev added a commit that referenced this issue Feb 6, 2025
akleshchev added a commit that referenced this issue Feb 6, 2025
akleshchev added a commit that referenced this issue Feb 6, 2025
akleshchev added a commit that referenced this issue Feb 6, 2025
akleshchev added a commit that referenced this issue Feb 7, 2025
akleshchev added a commit that referenced this issue Feb 7, 2025
akleshchev added a commit that referenced this issue Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Flags issues that need to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant