Comments (4)
Wow, that's some intense savings. Nicely done!
from unitygltf.
I noticed that buffer data gets copied to the buffer view objects, which get copied to the accessor objects. All the copying seems wasteful, wouldn't it make more sense to provide access to the original buffer via a function that maps the index space? So in lieu of bytes[] GLTFBuffer.Data
, you might have bytes[] GLTFBuffer.GetBytes(int offset, int byteLength)
, and have GLTFBufferView
implement the same interface. That way you don't have to copy anything until it's converted to its final type in the accessor.
from unitygltf.
Performance greatly improved via manual deserialization in db40b19
Previously we were using JSON.NET's JsonConvert.DeserializeObject which uses reflection to deserialize the provided object.
I've moved everything to manual deserialization which removes all reflection and really speeds things up.
Sample Model | Reflection Parse Time | Reflection GCAlloc | Manual Parse Time | Manual GCAlloc |
---|---|---|---|---|
Lantern | 389.40ms | 7.6MB | 31.56ms | 99.6KB |
Corset | 377.99ms | 7.8MB | 29.36ms | 55.7KB |
BoomBox | 384.86ms | 7.8MB | 29.29ms | 85KB |
There's probably still a lot more room for performance improvements, but I'm feeling pretty good about our parsing performance now.
from unitygltf.
Any idea why parsing here would be slower than JSON parsing in e.g. the browser? All three of the sample models above take ~3ms with JSON.parse()
in Firefox, or 10x faster.. I suppose that's partly because the C# is processing the model into structured objects and typed values, whereas JS is looser about this? I'm testing on a different machine here of course, but it's a fairly old laptop so I'd be surprised if that's the difference.
from unitygltf.
Related Issues (20)
- Issues building for runtime loading HOT 2
- File Names are wrong HOT 2
- Sample file that demonstrates the use of animation pointers and texture transform HOT 1
- Unity WebGl build error HOT 6
- Get the json from the gltf HOT 7
- CameraSampling for Volume and Transmission is upside down! HOT 1
- Textures with huge amount of allocating memory in Unity HOT 3
- Sample embedded texture in a shader HOT 4
- Shader Variants / Huge ammount of Shader Variants HOT 6
- Document non-tri mesh topology behaviour HOT 6
- Humanoid import bone mapping is missing a specific direct mapping HOT 5
- Mipmaps import setting is ignored for KTX textures (one-line fix)
- How to access "ShaderOverride"?
- Critical Bug: Namespace "System" missing in GLTFComponent for UWP HOT 2
- File with absolute reference does not load
- Help with Callback on onLoadComplete HOT 1
- Animation Pointer Error HOT 2
- Question: How can I share textures, meshes and other important assets b/w multiple instances of a GLB loaded from UnityGLTF HOT 9
- Timeline Recorder HOT 2
- Audio Plugin Testing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unitygltf.