Large program UI lagging problem(windows)

Issue #281 resolved
Wenjie Wu created an issue

User reports from Silicon Valley-Mars Environmental Exploration Challenge.

Many users were using Windows to participate in the challenge and they reported frequent UI lagging problems (when the program was large)

This video shows the problem:

https://scratch3-files.just4fun.site/b2156c9468c9ce26f080fb4fd062d342.mov

This is his code (Lots of My blocks):

https://scratch3-files.just4fun.site/Sample V2.ubp

Comments (8)

  1. Turgut Guneysu

    Hi Wenjie,

    While I could not exactly perceive the problem you have described in the video provided, I did the following tests and wanted to share the results with you:

    I loaded your sample program, opened all custom blocks to display their code.

    I tested this setup in:
    1. Chrome with just MB running
    2. Chrome with three tabs and MB running
    3. MS Edge with six tabs and MB running
    4. Stand-Alone MB (not the Chrome version)

    Then I edited the script that was giving you the size errors. Separated blocks, moved them around, re-join them, Copy and pasted blocks to / from clipboard. In other words as much of a full set of editing as I could think of.

    Results:

    1. Single Chrome session was very slightly delayed but very workable
    2. Multiple tab Chrome exhibited much more noticeable delays
    3. Edge was much more responsive than single tab Chrome version
    4. Most performant, with no perceptible delays was the Stand-alone MicroBlocks.

    I am not sure which of these are available to you or feasible to use, but given the size of the projects you are dealing with and lengths of the custom functions, it might be helpful to use the stand-alone version.

    Or at least try to minimize tab counts in Chrome.

    I have shared this incident with John. He is currently busy with a two week training session and he will address it when his training sessions are finished by early August.

    I would think that individual PC configurations would also have an influence on how these environments described above behave. In that regard, I would like to share my PC specs so you can gauge better:

    Device name Lenovo Yoga 900 Laptop
    Processor Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz 2.59 GHz
    Installed RAM 16.0 GB
    System type WIndows 10 Home edition 64-bit operating system, x64-based processor
    Pen and touch Touch support with 10 touch points
    Running on SANDisk 1TB SD drive.

  2. Wenjie Wu reporter

    Thanks a lot!

    While I could not exactly perceive the problem you have described in the video provided

    The description in the video is not important, you have reproduced the problem !

    I think your suggestion will be very helpful and I have synced it to the relevant users ! (We are currently using mostly webapp).

    I can't do the test because I don't have a Windows computer myself. I will update here tomorrow if users have further feedback.

  3. John Maloney repo owner

    Thanks for doing all those experiments, Turgut. I'm surprised that Edge is faster than Chrome; I thought they shared the same underlying codebase.

    Performance editing that project on my new MacBook Pro is fine, in both Chrome and in the stand-alone app., Of course, any lag issue will be more noticeable on slower computers. I'll check that project on a slow Chromebook when I get a chance.

    Unfortunately, there's no "quick fix" for the lag issues. About a year ago, I spent about six months reworking the graphics system to make it as fast as possible so the display code is already highly optimized. There is one more optimization I can try, but I won't have a chance to implement it until September, which is probably too late for the programming challenge.

    When does the programming challenge end?

    Short, term, using Edge or downloading the stand-alone MicroBlocks app provides the best performance on Windows. You might recommend that to users who report lag issues.

    It also helps to hide all user-defined functions that you are not actively editing. The fewer blocks there are in the scripting area, the faster it is to update the display when editing or scrolling.

  4. Wenjie Wu reporter

    I'm surprised that Edge is faster than Chrome; I thought they shared the same underlying codebase.

    I am surprised too .

    Performance editing that project on my new MacBook Pro is fine, in both Chrome and in the stand-alone app.

    On my MacOS(Macbook Air M1), webapp performance has always been good.

    When does the programming challenge end?

    In many provinces of China, the provincial challenge are already over and the national competition is still some time away, but it's close.

    But I think the optimization of webapp(on Windows)is worth it in the long run, there are a lot of users (at least in China) using it, native software is not as convenient as Webapp (especially considering the software updates)

    I'm currently trying to convince the managers at Elite that MicroBlocks is in rapid development and that these issues will continue to be optimized, and they recognize the promise of MicroBlocks, so they intend to promote MicroBlocks in more projects.

    Short, term, using Edge or downloading the stand-alone MicroBlocks app provides the best performance on Windows. You might recommend that to users who report lag issues.

    I have shared Turgut Guneysu‘s recommendations.

    It also helps to hide all user-defined functions that you are not actively editing. The fewer blocks there are in the scripting area, the faster it is to update the display when editing or scrolling.

    Yes, I did suggest that.

  5. John Maloney repo owner

    But I think the optimization of webapp(on Windows)is worth it in the long run, there are a lot of users (at least in China) using it, native software is not as convenient as Webapp (especially considering the software updates)

    Agreed! I will work on that optimization at the end of August when I return from teaching and a short vacation. I will ask you to help with testing. :-)

    I'm currently trying to convince the managers at Elite that MicroBlocks is in rapid development and that these issues will continue to be optimized, and they recognize the promise of MicroBlocks, so they intend to promote MicroBlocks in more projects.

    Great! The optimization I have in mind will speed up text rendering. The savings for English isn't huge but it might have a bigger payoff for Chinese.

    In any case, I hope things have gone well enough with MicroBlocks so far that Elite is willing to stick with it and help it become even better.

  6. Wenjie Wu reporter

    Looking forward to your future optimization work, I'm very happy to participate in the test :-)

  7. John Maloney repo owner

    I've pushed the optimizations that address the lag issues to the stable release last week. (They have been in the Pilot release since October.) Although it can take many seconds to compile and download the code for a large project when the project is first loaded and the board is first attached, editing interactions after that are much less laggy than they were. There is also a progress indicator that indicates when code is being downloaded to the board.

    I am going to mark this issue resolved. If there are still lag problems, please start a new issue and, if possible, provide a specific, reproducible example. Thanks!

  8. Log in to comment