Make sure the validation queue does not freeze when an error occurred during validation.#964
Make sure the validation queue does not freeze when an error occurred during validation.#964Svelix wants to merge 1 commit intofeathersui:v1.3.xfrom
Conversation
… during validation.
|
While this seems like a good idea to help reduce the impact of runtime errors, the performance impact would be too severe. It's already too easy to create slow content. Even if it's only 30%, and not 2-3x, that's brutal on low-end devices. I wonder if a temporary uncaught error listener would offer the same advantage without the hit on performance. |
|
I am always guarded when it comes to as3 performance tips that are based on tests that are made 4 years+ ago. So I took the the code from the first link you provided and put it into an AIR app build with AIR SDK 13. This are my results in a Desktop App: And this are my results in a mobile App running on a Galaxy S3: I have no idea why the desktop version is that much slower than the mobile one, but as you can clearly see there is no big difference between try-catch and no try-catch when used with up-to-date compilers. |
|
Except that you should also probably do a test with a version compiled for iOS .ipa using a release build, since iOS converts these try/catches into native versions and you probably can't make the same assumption about the results above when it comes to iOS |
|
On Windows 8.1, I can confirm that try-catch doesn't seem to have the performance impact it once had. I haven't tried other platforms yet. iOS would be the most interesting, as Jeff mentioned, since it runs AS3 so much differently than other platforms. Jackson Dunstan also has an article about performance penalties when using finally (from 2012, this time). I can reproduce a performance difference with the code posted there. |
When an exception is thrown during the validation of any item, the validation queue is stopped because
_isValidatingwill staytrueforever.We show an error dialog to our users when an uncaught exception is thrown. Unfortunately this error dialog is never shown correctly cause it will not be validated in this case.
I added a simple
try..finallyblock to the validation queue to prevent this scenario. This way the error is handled the normal way and the next time the validation is triggered it will continue normally with the item that is after the one that caused the error.