feat: refactor code + optimizations for obj file parsing

This commit is contained in:
2025-10-01 17:55:29 +02:00
parent 2b0494a23d
commit fc91f6662e
10 changed files with 510 additions and 235 deletions

View File

@ -27,3 +27,16 @@ The run command in that case would look following:
```console
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./build/CodingGame
```
## TODO List
### Optimizations
🚀 Summary of Speedups
- Replace toElement / toMtlElement string comparisons with char-based switches.
- Replace std::stoi with a custom fast Parser::TakeIndex.
- Pre-reserve vectors for vertices, normals, texcoords, meshes.
- Load whole file into memory before parsing (fastest for large OBJs).
- Defer texture loading until after parsing.
- Store material pointers in meshes → no runtime lookups in render.
- Inline parsing functions.