Performance stats: `ModelExperimental` vs `Model`
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 32
Description
Now that the `ModelExperimental` implementation is pretty far along, we wanted to start measuring its performance compared to the old `Model`. This issue is to record the results.
## Testing Loading Time
To start simple, I performed a test of loading times for a few tilesets to cover some common cases.
* Data Used:
* CDB San Diego model ([EULA](https://github.com/CesiumGS/cdb-to-3dtiles/blob/main/Doc/SanDiego_CDB_EULA.pdf). tiled with [`cdb-to-3d-tiles`](https://github.com/CesiumGS/cdb-to-3dtiles)) - this is a collection of 4 tilesets, a mix of `b3dm` and `i3dm` models. This tileset features a lot of textures shared between tiles for the buildings.

* Melbourne Photogrammetry (Modified from [City of Melbourne 3D Textured Mesh](https://data.melbourne.vic.gov.au/Property/City-of-Melbourne-3D-Textured-Mesh-Photomesh-2018/d5tb-r7a6) [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/legalcode)) -- an example of `b3dm` photogrammetry

* Helsinki Point Cloud (courtesy of Aalto University with support from City of Helsinki https://zenodo.org/record/5578198#.YjoTWBNKiu4) -- an example of `pnts` point clouds.

* My Sandcastle Setup
* See #10316 for my basic approach
* Browser: Chrome 100.0.4896.127 (Official Build) (64-bit)
* OS: Kubuntu 18.04
* There were some differences, as some of the local tilesets were gzipped. In the spreadsheet (see Results below) I marked cases where the tilesets were compressed.
* Sandcastle links
* I used several Sandcastle links with slight modifications (e.g. changing the `enableModelExperimental` flag). The spreadsheet includes links for every variation used. The links here are just a representative set.
* Note that these links require the local _built_ version of `Sandcastle`:
* [CDB San Diego](http://localhost:8080/Build/Apps/Sandcastle/index.html#c=pVZbb+I4FP4rFtqHIIFzJQn0otV0u09dzUqt5qVUMyY5gGeMjWyHtlvx39exE0hop33oSy7H53zfuSdXoGi1wddPW5B0A1wT9jcQXUlQGDhZMPhHlMC65+gCaVnB2ZzPeSG40mhH4RGkkXN4RFcO8ZuVefNBYd+vhDGlHOR8MEIvc47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n3WyF1PVXwMPY17DZMmIc8RdV8ct0bqFUW+Nzv2t6XtIdouXFG/9tyP6JmZNlxdgt/c/M7OW5b/RfmTIzbJSvvppuYeS5VluHlzdOiDE+983r25ZaCLYg8gT5fw)
* [Melbourne Photogrammetry](http://localhost:8080/Build/Apps/Sandcastle/index.html#c=hVZtb+I4EP4rFroPQaJOQgglQKvTdXu6lbov2lYrnUp1axJTvOvYyHZoexX//cZ2AgnldvkAyXieecbzjMdcUc2qEl8/b6hiJRWG8D8pMZWiGlNBlpx+kAXl7XV0gYyq6GwhFiKXQhu0ZfSJKrAL+oSufMSvzhYserl7v5IAZYKqRW+AXhcCoUcul3SKVoRrOrAG/ePlD/lcWxZi13cMwMGJ1ugO2JVHOlJV5UaqgJMl5X1vR8ismcbOBMm431lrQRuijI0Di5Uo6AryKdoOVBQnl3f2y6VoIwRdunZUKNJKqpKInGIhn4L+MVxujtAHyl9gN4qJFrUvfMFWK6ooQP7RNIcgQSfo2VGGfRSiOIoiHM0OUSSnmMvHoBtrz747yGysBBpYXnezxrZRsmSaWuv9gxNsVYncMCmc+40khddogCrVCOWhipLixcvqO8c9B99+e3WAHQqcx2fP0P/mU/JYJphhhP8UvffhVNs8aNGNIbdUEf7zGLVPAzyACymsaHWzQ7MAzvs0FcGbSq8D64dr0yFGmxrXTeUWDzXpmJv6w06o6Z4z/5O8u/OLQd0fUGwnoMf7A4p1Tl02rITKbCFFUhRBHdU71i+4JM+srMrbXFEqbjckp9dKSVum0X4TjW9bJWzWVATQpheXTad2tmT7v+69toSdze76byjeSmlTv97CPLph2sCuVJf0KHiL9qj0rRUnFcw9ybf0VCq2+e9dYzzYM9Da3bS1yUEngWknk0EnhWknF0c3q8/b/ugseiXlS1kpQe3gXPTWxmymYchlTvhaajOdRNEwhPIZlod1uXS4B53ZqdLY8XctxaLn52ojGPAHTcv2bRInJIS5hALfg/f1Ya5DutT1A5Ir9Gn5neYGZo9RjOrA16u/H1jdYePH9qxZ6kTzDYXrgfc/PnVZf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5UYPuoa/RmWbFeAQ9MX5+d163dyoEdmKpZmzVvZWf7muJ17a1Llxuzv66oMqGYcrVID8AbtAe1apy42po9KdgGjrlip+XWddKdHZpGdNNGkL2WA9OWJ72WC9OWL45uVg3obtbmnYJrZXfsvLPSupiGIRMZYSuh9DSNoiQ0mdM0C6tMqXAFTFH+QHcPJxahPsdfleDzjg0rDA9YTnJJMvH/uTzOTzHef6PFLyC0MD8f4a9i3YMd4Z7zeiJMgYN6iXRtlY/MiLkpUOC3wm21XitI1xvqDokl+rD4Cpk2t4GWFFTgG7K7u0La699fpLP6qIXmJxZXV9B/6FR9+wOtqoN3WsirbXfDM+etnZIRY0awAbDfE/V2y0Fpyv02mra2odkK5onwfpCkaTweD3DSj/rpaBDHPRT3B8koifAoikbpcJQM0x4aDuMo7Q9xkkRpPBhHabceOpM0ro9w/AVuJX6kOlv9LUyxhtiYTeIoHg0naTTqG6aTyABO+oZkkiSjwWQSD3sowel4GI8HUZymo9Row8m4ZrNXtiRc2U8AQ1dRvSOmdE8D/PbN5fubtzef3TdRp9c5VfqZwXmd4t/puhBS26UfYBxqWBeMmDyEizJ7MF2WKVXX4zRsmp7mdINofnbkIw25zy5zsiwZu6bfYN45Pw2N/itTJlw+PpjKMvJs1Vbx+ZUXYoxPQ/N63FILwRZEHiD/Cw)
### Results
All the results can be found in this spreadsheet. For the color-coded cells, green means `ModelExperimental` was faster, red means `ModelExperimental` was slower at loading the model.
[Performance Stats.xlsx](https://github.com/CesiumGS/cesium/files/8573025/Performance.Stats.xlsx)
Preview:



### Takeaways
* Overall the performance felt comparable, loading times differed by a couple seconds, not tens of seconds or more. That said, in most of the cases, `ModelExperimental` was slower, so it's worth investigating further.
* the CDB elevation and buildings were two cases where `ModelExperimental` performed better. This may be due to the fact that these models share textures. `GltfLoader` has better texture caching than the old `Model`; no duplicate textures should be uploaded to the GPU. However, profiling memory would be a better way to check if this is true.
* Point clouds were the area where `ModelExperimental` performed the worse by percent difference. The new `PntsLoader` does work differently than the old `PointCloud` class, so it would be good to profile this further.
* Likewise, other cases like the photogrammetry one should be profiled further to see why things are slower.
* It would be good to test memory too, though we'd need to implement #9886 first.
CC @lilleyse @j9liu @IanLilleyT
Contributor guide
Assessment
This issue has not been assessed yet.