|
|
|
This is what flasm does:
TAG_SCRIPTLIMITS = 65 void writeScriptLimits(unsigned int recursion, unsigned int timeout) { writeTagHeader(TAG_SCRIPTLIMITS, 4); flputShort(recursion); flputShort(timeout); } I was thinking we should support something like #pragma "ScriptLimits(recursion, timeout)" Where would the #pragma go? In a <script> block in the canvas?
That was the plan. Unless someone has a better idea. Henry thought about making it a canvas attribute, but it seemed to me to be too platform-specific for that.
After looking at this, it will be really messy to implement this as a pragma in a script tag. Is there any objection to using Henry's idea?
From the test case, I observe two things which may be of interest:
1) When the recursion limit is exceeded, the application silently fails (becomes non-responsive). 2) The timeout limit can only be increased to a maximum of 60 seconds. Why is the maximum timeout limit 60s? When I used swfsli, I was able to set my timeout to 300s. Is there a reason that you can only go as far as 60? Maybe SWF 7/8 differences?
I can set the timeout to anything I like, but I still get a "Script Running Slowly" after 60 seconds. Did you actually measure how long you can run before getting the running slowly prompt? Does anyone think that a user is going to patiently sit there for more than a minute without seeing some sort of UI update?
r7448 | ptw | 2007-12-04 23:23:05 -0500 (Tue, 04 Dec 2007) | 38 lines
Changed paths: M /openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx M /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java Change 20071204-ptw-z by ptw@dueling-banjos.local on 2007-12-04 17:04:11 EST in /Users/ptw/OpenLaszlo/ringding-2 for http://svn.openlaszlo.org/openlaszlo/trunk Summary: Implement scriptlimits for SWF runtime New Features: The canvas tag has a new attribute, swflimits which is of type css, which can be used to override the default recursion (256) and timeout (15s) limits. To do so you say: <canvas scriptlimits="timeout: 30"> or to override both limits <canvas scriptlimits="recursion: 300; timeout: 30"> Bugs Fixed: Technical Reviewer: henry.minsky@gmail.com (message://<8c61fad60712041542w5c964533v4f36a1d693b63f72@mail.gmail.com>) QA Reviewer: antun@laszlosystems.com (pending) Doc Reviewer: lou@louiorio.com (pending) Documentation: See "New Features". For complete example demonstration, see the test case attached to the bug. Details: schema/lfc: add scriptlimits attribute to canvas CanvasCompiler: parse scriptlimits and store in environment SWFWriter: Don't try to write scriptlimits immediately. When closing the file, if the limits have been set (are non-zero) add them. ScriptLimits: Correct defaults. If called with a 0 value, use the default. Tests: smokecheck, test case from Jira r7413 | hqm | 2007-11-29 09:01:34 -0500 (Thu, 29 Nov 2007) | 26 lines
Changed paths: A /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java M /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/util/Tag.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ObjectWriter.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFFile.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java Change 20071128-hqm-4 by hqm@DADDY_THNKPAD67 on 2007-11-28 19:58:01 EST in /cygdrive/c/users/hqm/openlaszlo/trunk for http://svn.openlaszlo.org/openlaszlo/trunk Summary: implement script limits tag New Features: Bugs Fixed: Technical Reviewer: ptw QA Reviewer: (pending) Doc Reviewer: (pending) Documentation: Release Notes: Details: implement scriptlimits tag Tests: ------------------------------------------------------------------------ hqm@DADDY_THNKPAD67 /cygdrive/c/users/hqm/openlaszlo/trunk2 r7459 | ptw | 2007-12-05 13:52:32 -0500 (Wed, 05 Dec 2007) | 34 lines
Changed paths: M /openlaszlo/branches/4.0.5.1 M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/schema/lzx.rnc A /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java (from /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java:7413) M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/util/Tag.java M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/ObjectWriter.java M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFFile.java M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java A /openlaszlo/branches/4.0.5.1/test/lpp-5088.lzx Change 20071205-ptw-1 by ptw@dueling-banjos.local on 2007-12-05 13:39:29 EST in /Users/ptw/OpenLaszlo/4.0.5.1 for http://svn.openlaszlo.org/openlaszlo/branches/4.0.5.1 Summary: Implement scriptlimits for SWF runtime New Features: The canvas tag has a new attribute, swflimits which is of type css, which can be used to override the default recursion (256) and timeout (15s) limits. To do so you say: <canvas scriptlimits="timeout: 30"> or to override both limits <canvas scriptlimits="recursion: 300; timeout: 30"> Bugs Fixed: Technical Reviewer: henry.minsky@gmail.com (message://<8c61fad60712041542w5c964533v4f36a1d693b63f72@mail.gmail.com>) QA Reviewer: antun@laszlosystems.com (pending) Doc Reviewer: lou@louiorio.com (pending) Documentation: See "New Features". For complete example demonstration, see the test case attached to the bug. Details: Merged revisions 7413,7448 via svnmerge from http://svn.openlaszlo.org/openlaszlo/trunk Added test/lpp-5088 to demonstrate the use of the feature Tests: smokecheck, test case (4.0.5.1 branch build r7467 - XP, OS X)
(4.0.5.1 branch build r7479 - linux) -testfile ran successfully in all 3 platforms -checked release notes -also opened some applications |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I should also say that I was always under the impression that Adobe says you should _not_ increase these limits for production code. The default timeout is 15 seconds. If you get this warning, it means your app has not given any user-feedback for 15 seconds. The user is probably pretty annoyed by that point. It was my understanding this feature was so you could _decrease_ the limit for testing, to make sure your app was not close to the limit (and hence might trigger it on a slower machine).