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

Reduce modeler.Read helpers allocations #90

Merged
merged 5 commits into from
Aug 30, 2024
Merged

Reduce modeler.Read helpers allocations #90

merged 5 commits into from
Aug 30, 2024

Conversation

qmuntal
Copy link
Owner

@qmuntal qmuntal commented Aug 30, 2024

Reduce reflection usage in binary.MakeSliceBuffer to improve performance.

goos: windows
goarch: amd64
pkg: github.com/qmuntal/gltf/modeler
cpu: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz

                      │  old.txt   │               new.txt                │
                      │    B/op    │    B/op     vs base                  │
ReadAccessorSparse-12   296.0 ± 0%   248.0 ± 0%  -16.22% (p=0.000 n=10)
ReadAccessorBuffer-12   24.00 ± 0%   24.00 ± 0%        ~ (p=1.000 n=10) ¹
ReadAccessor-12         72.00 ± 0%   72.00 ± 0%        ~ (p=1.000 n=10) ¹
ReadIndices-12          56.00 ± 0%   32.00 ± 0%  -42.86% (p=0.000 n=10)
ReadIndicesBuffer-12    48.00 ± 0%   24.00 ± 0%  -50.00% (p=0.000 n=10)
geomean                 67.24        50.52       -24.87%
¹ all samples are equal

                      │  old.txt   │               new.txt                │
                      │ allocs/op  │ allocs/op   vs base                  │
ReadAccessorSparse-12   6.000 ± 0%   4.000 ± 0%  -33.33% (p=0.000 n=10)
ReadAccessorBuffer-12   1.000 ± 0%   1.000 ± 0%        ~ (p=1.000 n=10) ¹
ReadAccessor-12         2.000 ± 0%   2.000 ± 0%        ~ (p=1.000 n=10) ¹
ReadIndices-12          3.000 ± 0%   2.000 ± 0%  -33.33% (p=0.000 n=10)
ReadIndicesBuffer-12    2.000 ± 0%   1.000 ± 0%  -50.00% (p=0.000 n=10)
geomean                 2.352        1.741       -25.98%
¹ all samples are equal

@qmuntal qmuntal merged commit 19bcd97 into master Aug 30, 2024
14 checks passed
@qmuntal qmuntal deleted the profread branch August 30, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant