![]() ![]() ![]() Would a change, away from blob, matter if we only target modern none mobile browser (>= IE11)?.Maybe loading the build as a blob has something to do with cross browser compatibility or does it has any benefit I don't see?.This is why some questions came up my mind: So I didn't want to spend too much time on benchmarking something which is maybe not feasible or a bad approach. This is why I wonder if I miss something and therefore don't see the benefit of loading the build as a blob. Further I remember that the "blob-approach" was introduced in some version of Unity. I think this is due to the fact that Firefox deactivates asm.js if the console is opened. I only did the measurements on Chrome because Firefox always crashed when I opened the console. You can find the detailed measurements here. On my machine adding a script tag with src "to the file" instead of the blob is about 12% faster than the blob variant. This method is also faster than the regular Unity approach. Doing it this way you could include a different file if ound wouldn't be available. So I benchmarked the idea of adding the script tag dynamically via JavaScript to the index.html file. I saw that the UnityLoader does some checking if ound is available and if not the UnityLoader edits the blob in some fancy way. The fastest way was to include a script tag with an async attribute at the end of the index.html file. Unity loads the build as a blob and in my benchmarks this was the slowest way of loading the build (to be correct, the main time is not spent on "loading", we cache our js files, it is spent on interpreting/compiling the huge js file). Beside the fact that the build is 25mb (unzipped) of JavaScript (and there is nothing we could do, to further trim it down), I tried different ways of loading the build. This is why I did some research on speeding up the loading process of our Unity build. Loading time is very crucial for us and we are not fully satisfied with Unity's performance in this regard. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |