Throttle Calls to MockForm.refresh()
Limit the number of calls to MockForm.refresh(). This lets a project with a lot of designer objects load when otherwise the exponential time and space consumption of repeated and nested calls to refresh() would cause it to fail to load. This implementation throttles the calls “locally.” The idea is to limit the number of calls to 1 every 2 seconds. An alternative implementation would be to set a flag while a project is loading (which is when this is a problem) and inhibit all calls to refresh while this flag is set. Then when the project is no longer loading, clear the flag and do one final call to refresh. However this would be tricky because loading is asynchronous and knowing when it is completely finished is complicated. Such an implementation would be spread over several modules, and add complexity to the codebase. This change is simpler because it is limited to one module. We also add a logging call Ode.CLog to Ode that logs to the developer console instead of the OdeLog module which logs to the special debug tab. There are situations where logging to the console is desirable, like when the problem you are attempting to debug leaves App Inventor locked up so you cannot see the debug tab! Change-Id: I5fb9c832704e87c6e73903dc3a75ceb79df5f7f3
Showing
Please register or sign in to comment