Three.js: editor freezes for a moment after *every* change in it.

Created on 27 Feb 2019  路  3Comments  路  Source: mrdoob/three.js

Description of the problem

I drag'n'drop a 3.2 mb FBX (created in 3ds max 2016), plus some 30 jpg textures with 256-2048 resolution. Every single time when I make a change in the scene, the editor freezes for several(tens of) seconds. The heavier the scene, the longer the freeze.

Browser
  • [ ] All of them
  • [x] Chrome
  • [x] Firefox
  • [ ] Internet Explorer
OS
  • [ ] All of them
  • [x] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Editor Enhancement

Most helpful comment

That's because autosave is on. The current autosave feature is not optimal (it serialises the whole scene graph).

All 3 comments

That's because autosave is on. The current autosave feature is not optimal (it serialises the whole scene graph).

Thanks for the fast replies !
Confirmed, it is the autosave . Maybe the default setting should be autosave = off for now?

My 2 cents:

I used to have JSON serialization in my game engine, which was fine up to around 10Mb states, beyond that it started to really harm user experience when game was.. you guessed it: autosaving. I'm currently using a custom binary serialization scheme, which works 2 orders of magnitude faster and uses less space, which is a nice bonus. Not that editor is the most important part of three.js project, but it might be worth investigating some binary serialization schemes, like, say, avro.

I also found that writing a custom JSON -> string serializer helped a ton, if you can build a string incrementally as you go - it turned out about 3x faster, I don't really know why though.

Another avenue if to have record discrete changes and update save state incrementally.

Yet one more is do some heavy lifting in a Worker thread.

@jazznazz for your case, I'm guessing that texture serialization takes the most time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

konijn picture konijn  路  3Comments

jlaquinte picture jlaquinte  路  3Comments

boyravikumar picture boyravikumar  路  3Comments

akshaysrin picture akshaysrin  路  3Comments

donmccurdy picture donmccurdy  路  3Comments