Search Unity

what is "UnityLoader.js:1 pre-main prep time: 27213 ms" and how to improve performance

Discussion in 'Web' started by cchacon, Apr 18, 2016.

  1. cchacon

    cchacon

    Joined:
    Sep 20, 2015
    Posts:
    18
    Hello everyone,

    I'm trying to optimize my application initialization time, I'm seeing something called "pre-main prep time" taking 27 seconds (27213ms). Anyone knows what is this?

    UnityLoader.js:1 pre-main prep time: 27213 ms
    Module.printErr @ UnityLoader.js:1
    doRun @ blob:http%3A//vr.aigoo.com.s3-website-us-west-1.amazonaws.com/cdbcebec-c6c2-48bf-aa72-c1e28b9ed388:36
    (anonymous function) @ blob:http%3A//vr.aigoo.com.s3-website-us-west-1.amazonaws.com/cdbcebec-c6c2-48bf-aa72-c1e28b9ed388:36

    Thanks,
    Carlos
     
  2. alexsuvorov

    alexsuvorov

    Unity Technologies

    Joined:
    Nov 15, 2015
    Posts:
    327
    Hello cchacon.

    Does not seem to cause any delay at least on my machine (pre-main prep time: 211 ms). However this may be related to the amount of memory you are allocating. Do you really need 1.5 GB? If you change it to 512 or 768 MB will it make any difference for your pre-main prep time?
     
  3. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    I think that this time is related to the downloading of data files. @alexsuvorov , you were probably looking on a local machine, hence, no download :)
     
  4. alexsuvorov

    alexsuvorov

    Unity Technologies

    Joined:
    Nov 15, 2015
    Posts:
    327
    Yes, @jonas echterhoff you are right. The delay is introduced due to the data file being too large.
    Moreover, the actual problem here is that in most browsers such data file will not be cached. For example, Firefox has default limitation for cached file size of 50MB, while the data file in question is 55MB.
     
  5. cchacon

    cchacon

    Joined:
    Sep 20, 2015
    Posts:
    18
    Thanks guys for confirmation that this is due to data file been large.