Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Does Studio lag behind Player? — Gideros Forum

Does Studio lag behind Player?

I think I found a substantial lag between Gideros Player executing code and Studio's output window receiving output, and this made me curious.

I had a bug which seemed to crash my game before it could log anything. I found my problem using the debugger, but I am still puzzled how the crash seemed to "outrun" print(). The bug was after 100 lines of code, but output from several print() calls before line 100 never arrived in Studio's output window.

1- Is the lag entirely a result of the player and studio communicating over a network, basically my home WiFi?

2- I found this lag affected print()'s output. Can assert() or other core Lua error-reporting functions "outrun" crashes?

3- When an uploaded program crashes, is there a local log file or error file I can find and read?


I never took a CS course, so thanks for helping a hobbyist out!
Tagged:

Comments

  • hgy29hgy29 Maintainer
    print ouput (to the studio) is sent over a TCP connection asynchronously: the player enqueues its print output at one end of the TCP socket and the studio fetches the output at the other end.

    Player outbound queue is emptied a bit each frame (up to 1024 bytes), so at 60fps the player can't send more than 60k characters of output per second. But between each 1k bloc, your lua code (events/enterframe) is executed too, which could limit the throughput even more. In addition, the player will refuse to enqueue more than 1024 packets for the studio, so if you use print a lot, you may hit this limit too. It is worth noting that each argument of a print call will count as two packets.

    Then if you experience a hard crash (player closing), there are chances that enqueued packets will never reach the studio before the crash.

    Finally the studio itself may take time processing the debug lines and appending them to the output window.
  • Sleet_ScranivmSleet_Scranivm Member, test
    Thanks for the detailed reply.

    My bug happened immediately after procedural generation of a map, so that probably used up all the throughput.

    It seems the debugger is essential for understanding such crashes so I should practice using it more often!
  • hgy29hgy29 Maintainer
    Thinking of it, the debug throughput could be improved a lot by merging new debug chunks together until they reach the packet size limit. That would be more efficient for both the player and the studio, and would allow almost 1MB of debug until we start dropping packets.
Sign In or Register to comment.