Search Unity

Question Why does my thread work seem to be abnormal and the resources are not being used properly?

Discussion in 'Editor & General Support' started by Werido, Nov 23, 2020.

  1. Werido

    Werido

    Joined:
    Jan 15, 2017
    Posts:
    7
    My program is always stuck when running on the real machine. When the profiler is running, a certain frame takes 15 seconds. I can't believe my eyes. I want to ask why there are vacant time slices?
    Lua01.png
    Lua02.png
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    That would seem to indicate the time is taken up by the internals of the lua_pcall() method itself. or perhaps it is a native function call that the Unity profiler doesn't have enough information about to display.
     
    Joe-Censored likes this.
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,455
    Unity doesn't have any kind of official support for Lua for scripting so I guess you're using some asset store package or similar plugin? Could it be that all hat time is spend in Lua calls? The Deep Profiler can only add instrumention for C# (Mono/IL2CPP) calls so that'd be reason for there to be no profiling samples beyond this sample ...

    No idea if that Lua plugin has way to call back to Unity's ProfilerMarker code but maybe that could be a way to add instrumention yourself?
     
    Joe-Censored likes this.
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'd send this same question to the creators of whichever Lua plugin you are using. They probably have more experience with this issue. Also see if they have their own user forum.
     
    MartinTilo likes this.
  5. Werido

    Werido

    Joined:
    Jan 15, 2017
    Posts:
    7
    Thk
     
  6. Werido

    Werido

    Joined:
    Jan 15, 2017
    Posts:
    7
    Thk