I’ve been poking through UnityEngine.dll with ILSpy. As a bit of background, we’re seeing a huge hiccup with some downloads, and the Profiler (Deep Profile) reports the following tree:
...
WWW.get_isDone()
UnityCrossDomainHelper.GetSecurityPolicy()
...
So to try and track down what’s actually going on I delved into the UnityEngine dll, but under the definition for the WWW class I see the following:
namespace UnityEngine
{
public sealed class WWW : IDisposable
{
...
public extern bool isDone
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
Since there’s no DllImport, how can I determine where exactly this extern is pointing to? Where is isDone actually implemented?
Good Answer!
– YokimatoThanks, that mostly makes sense. Obviously I have more reading to do :) As for the particular hiccup, our code is pretty complex (50,000 lines) and we've built things like a download manager that wraps around WWW, so I would need to create a much simpler repro before folks would be of much help. Either there's something we're we've done that's making it look like WWW.isDone is taking a looong time (1150 ms for 47 calls in one case) or there's a Unity issue that's only showing up in our case. Nonetheless, I'll start another question and link it here. Thanks again for the help!
– Julien-Lyngeif you do the 47 WWW in parallel such a thing could happen especially when you do not properly interact with it from coroutine. Reason is that each WWW object has an own worker thread in the background, so if you fire too many in parallel you cause some nagging side effects. Especially as they finish the download and load the asset, they will halt the engine (bitmap loading, asset bundle decompress, movie loading and audio loading are all blocking, syncronous calls during which nothing else will take part. 1150ms sounds liek an asset bundle with a detailed mesh for example)
– DreamoraHere's the full question, hopefully that gives you guys a bit more info. I'll read your comments in a few, but first, lunch :) http://answers.unity3d.com/questions/440134/long-delay-with-wwwisdone.html
– Julien-Lynge> You'd have to disassemble it and read > it as assembler language. Then where the code located ,which dll ? in what language? Do you mean in C/C++? and where the dll ? regards!
– jzq740176597