archive-com.com » COM » C » CRAFTYMIND.COM

Total: 161

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Updated ‘Elastic Racetrack’ for Flash 9 and AVM2 | Craftymind
    irregular rendering Sean Christmann says April 18 2008 at 1 19 pm You re right its a bit confusing but I didn t want to annotate every reference to the length of a time slice or how that divides into 1000 milliseconds to remind readers it may change depending on their system I think that would ve been more confusing The point I wanted to make in the last section was that like a dvd player trying to use 3 2 pulldown to display a 24 fps movie on a 60 fps tv so will flash try use different amounts of time slices to create the visual framerate and the amounts may be different per frame causing irregular although probably not noticable rendering BTW on PC flash works off a minimum 17 millisecond Marshal which equates to roughly 60 fps or a maximum 100 millisecond Marshal which equates to 10 fps While the Mac appears to use constant length time slices of around 19 the PC will stretch them out depending on the user requested framerate most likely as an optimization technique Martin says April 18 2008 at 1 55 pm Austin You re right he should rephrase that as if your framerate is not divisible by the slice length for a system it may cause irregular rendering but that s saying nothing cos we already knew we couldn t trust on the length of the frame being the same as the framerate indicates But otherwise it s a really interesting read For instance I read that the fps affects the responsiveness of the textfield inputs for flex apps and I m sure it has to do with this In that case people recommended 60fps as the optimal solution since it doesn t consume more cpu and makes the interface more responsive Sean Christmann says April 18 2008 at 1 58 pm I ve changed some of the wording to clarify how the math may change for different platforms Austin Haas says April 18 2008 at 2 16 pm That s cool Btw I apologize for not complimenting you on the discussion first I appreciate your explanation of the system I read to the end and my first thought was Oh no Everyone is going to start saying that you have to use multiples of 50 fps and I didn t think that s exactly what you were trying to say zwetan says April 21 2008 at 11 16 am interesting but did you try those same tests by changing this flag in mxmlc for ex default script limits basically the elaticity of the FPS should be influenced by those parameters ex if you set 20FPS and wan to execute a lot of code or gfx rendering per frame the FPS will slow down but the script limits will cap how much the FPS can slow down I would love to see those slice of execution in the profiler in FB3 Tyler Wright says April 21 2008 at 12 19 pm Great article Though I believe your tests are all in context of a Flex project which can skew the results because of how Flex sets up the environment If not then something else is going on On Mac in Firefox 1 I ve also found that long code execution or heavy rendering slows events and that Flash still tries to keep the framerate on target as much as possible 2 From my experience Flash will TRY to match the framerate as close as performance will allow stage frameRate 1000 addEventListener Event ENTER FRAME enterFrameHandler startTime getTimer private function enterFrameHandler event Event void trace getTimer startTime output 29 42 45 50 54 59 63 69 3 The Timer will also fire events as quickly as performance will allow timer new Timer 1 add listener start timer the rest output 22 29 33 34 35 39 42 NOTE Event RENDER only triggers when a stage invalidate is called and b just before the Flash Player renders the display list the actual rendering of pixels to the screen not to be confused with Flex s redrawing and layout of components Flash Player renders to screen on every frame enterFrame AND whenever updateAfterEvent forces a refresh Whatever you re experiencing with MOUSE DOWN is a result of a MouseEvent listener calling the updateAfterEvent somewhere in your or some library your using like Flex code 4 Because of the great difference in our results I don t have advice to offer on this yet None of my data discounts a Marshall segmenting processes by time In fact it makes sense that the event firing system would be organized such to sustain overall performance But how are our results so different even IF you were using Flex I d love to see a presentation on the Flash Player event and rendering model as detailed as Gary Grossmans introduction to the new Garbage Collection in FP9 Sean Christmann says April 21 2008 at 12 46 pm tyler you re right i was mistaken in thinking that manipulating display objects automatically triggered a stage invalidate i fired up flash cs3 and noticed the same thing you and zwetan pointed out but mostly what I m seeing is that the Marshal is carving out 5 millisecond slices in the standalone player but using 10 millisecond slices in the browser I think this is important and I ll add it to the original article I m still seeing the same behavior though with regards to how a frame is assembled When publishing at 20 fps I get a frame that is made up of 10 slices in the standalone player and 5 slices in the browser Although just as I noticed in Flex the Marshal still uses the framerate to a degree to determine the length of each slice it should generate At 1 fps in Flash CS3 I still see 100 millisecond slices There must be internal logic in the Flash player that says a frame should never

    Original URL path: http://www.craftymind.com/updated-elastic-racetrack-for-flash-9-and-avm2/ (2016-04-27)
    Open archived version from archive


  • avm2 | Craftymind
    or rendering Inside each slice 5 possible steps are processed in the following order Player events are dispatched This includes events dispatched by the Timer Mouse ENTER FRAMEs URLLoader etc User code is executed Any code listening to events dispatched by step 1 are executed at this stage RENDER event is dispatched This special event is dispatched when the user calls stage invalidate during normal user code operation Final user code is executed User code listening specifically for step 3 is executed at this point Player renders changes to the display list The Marshal executes this 20 millisecond slice over and over and decides on the fly which actions to run The exact actions processed within a slice will ultimately derive the 2 main racetrack segments code execution and rendering that constitute a frame User actions and Invalidation actions fill up the code segment track while Render actions fill up the render segment track Its important to note that actions will only occur at times predetermined by the Marshal so a if you have a short running User action the Marshal will still wait a few milliseconds before moving on to the Invalidate and Render actions The best way to illustrate which actions are run and how the elastic racetrack is created is to look at how those slices are processed on a swf running at 5 fps 25 fps and 50 fps As you can see the elastic racetrack performs different actions per frame and requires a different visual illustration depending on the framerate that the player is trying to synthesize So for a swf running at 5 fps each frame processed 10 User actions 1 Invalidation action and 1 Render action At 25 fps each frame processed 2 User actions 1 Invalidation action and 1 Render action At 50 fps each frame processed 1 User action 1 Invalidation action and 1 Render action Whats important to note in the above chart is that some events are only available in certain slices For instance the Event ENTER FRAME event will only ever be dispatched in a slice that occurs at the start of a frame So what does this all mean Theres a couple quick ideas to take away from this Long running code execution or render segments can extend a given slice beyond 20 milliseconds Elasticity will be applied to that particular slice and the duration of the frame may or may not be extended as a result The Marshal may drop the number of slices that constitute a frame in order to keep the active framerate close to the compiled framerate A swfs real framerate won t exceed the Marshals rate defined for the player instance You can set your compiled framerate at 120fps but Flash will still only process 50 slices max that generate 50 render calls more or less depending on the system config Code can be executed more often then the compiled framerate A swf compiled at 1 fps can execute a Timer or

    Original URL path: http://www.craftymind.com/tag/avm2/ (2016-04-27)
    Open archived version from archive

  • elastic racetrack | Craftymind
    or rendering Inside each slice 5 possible steps are processed in the following order Player events are dispatched This includes events dispatched by the Timer Mouse ENTER FRAMEs URLLoader etc User code is executed Any code listening to events dispatched by step 1 are executed at this stage RENDER event is dispatched This special event is dispatched when the user calls stage invalidate during normal user code operation Final user code is executed User code listening specifically for step 3 is executed at this point Player renders changes to the display list The Marshal executes this 20 millisecond slice over and over and decides on the fly which actions to run The exact actions processed within a slice will ultimately derive the 2 main racetrack segments code execution and rendering that constitute a frame User actions and Invalidation actions fill up the code segment track while Render actions fill up the render segment track Its important to note that actions will only occur at times predetermined by the Marshal so a if you have a short running User action the Marshal will still wait a few milliseconds before moving on to the Invalidate and Render actions The best way to illustrate which actions are run and how the elastic racetrack is created is to look at how those slices are processed on a swf running at 5 fps 25 fps and 50 fps As you can see the elastic racetrack performs different actions per frame and requires a different visual illustration depending on the framerate that the player is trying to synthesize So for a swf running at 5 fps each frame processed 10 User actions 1 Invalidation action and 1 Render action At 25 fps each frame processed 2 User actions 1 Invalidation action and 1 Render action At 50 fps each frame processed 1 User action 1 Invalidation action and 1 Render action Whats important to note in the above chart is that some events are only available in certain slices For instance the Event ENTER FRAME event will only ever be dispatched in a slice that occurs at the start of a frame So what does this all mean Theres a couple quick ideas to take away from this Long running code execution or render segments can extend a given slice beyond 20 milliseconds Elasticity will be applied to that particular slice and the duration of the frame may or may not be extended as a result The Marshal may drop the number of slices that constitute a frame in order to keep the active framerate close to the compiled framerate A swfs real framerate won t exceed the Marshals rate defined for the player instance You can set your compiled framerate at 120fps but Flash will still only process 50 slices max that generate 50 render calls more or less depending on the system config Code can be executed more often then the compiled framerate A swf compiled at 1 fps can execute a Timer or

    Original URL path: http://www.craftymind.com/tag/elastic-racetrack/ (2016-04-27)
    Open archived version from archive

  • Kick starting the garbage collector in Actionscript 3 with AIR | Craftymind
    the initial design of the Flash player I described above All the effort was put into making a killer GUI environment that deferred memory management to whether the browser window was open or not and as a result the memory system was not optimized for more aggressive use cases I can only guess the problem comes from the fact that AS3 code is attached to the timeline of the player itself and managed by the elastic racetrack As a result both AS3 objects and render data get mixed in to the same memory page and releasing just the render data doesn t matter when model data is placed on the same page Adobe has assured me they are working on the problem but it realistically won t make it in until after AIR 2 0 and its unclear whether those fixes will be merged into the the plugin player given that the need isn t very high for web pages Until then you can not count on creating an application in AIR that releases memory back to the OS The best approach is to reuse the smallest amount of displayobjects possible to achieve the desired workflow Get used to adding and removing children without destroying them but instead sliding them off into a pool for later reuse as this helps keep the memory plateau low during use Post navigation Previous Post Hacking width and height properties into Flex s CSS model Next Post Why Bubblemark is a poor ui benchmark 31 thoughts on Kick starting the garbage collector in Actionscript 3 with AIR Bjorn Schultheiss says April 9 2008 at 10 21 pm Interesting read Those last 2 months must have been painful Have you still included the system tray functionality in light of the problems with not being able to manage rendering memory Sean Christmann says April 10 2008 at 3 26 am Yeah system tray mode made it into the 1 0 product It was really important that we include it in the launch feature set so now the team is working on lowering the overall memory footprint by finding better ways to reuse DisplayObjects Tom Nussbaumer says April 16 2008 at 3 43 pm That explains most of the effects I m struggling with Thank you for sharing Maz says April 21 2008 at 7 02 am Hi Sean Very nice feedback on your performance experience with eBay Desktop I was actually looking for something like this thanks You are totally right Flex wasn t initially memory oriented Flash 9 brought performance not memory rationals The AIR apps physionomy lifecycle are very different from their browser counterpart I am even starting to think that AIR will never see apps expected to run for hours before shutdown I ran all major AIR apps ADC desktop Google Analytics all are very hungry It is also the case of my application http labs businessobjects com biwidget a Widget Engine supposed to start and close with the OS Even after cleaning this app will never last more than 5 hours Do you have any bug number where we could bring our vote That s a very serious bug that should be adressed in AIR 2 0 Flex 4 0 Maz Bob says May 8 2008 at 12 22 am Hi Sean I got the same problem with releasing memory in flash thanks a lot for sharing your experience to confirm my question that memory issue still hanging in Flex3 Have you see google map in flash version website http www flashearth com This website could add release memory by navigating the map but the problem I saw memory still can not release totally from the beginning Sean Christmann says May 13 2008 at 4 43 pm Bob I haven t seen that app before but it looks interesting The best strategy I could offer for keeping memory low for that app would be to use a static number of Loaders and reuse them for new image requests Markus Kohler says June 18 2008 at 5 41 am Hi This all sounds to me that maybe Java still as a chance to come back as soon as people realize that Flex Air is not yet ready for high performance long running desktop applications Check my blogs at http kohlerm blogspot com for how easy it is in Java to find memory consumption problems Regards Markus Tecsi Aron says August 28 2008 at 11 42 am Hey Got the same problem as described above After half an hour of regular use my app got from 30 meg so 200 megs of RAM Not a big problem some might say but one of the project goals was to keep minimum system requirements as low as possible My Solution was a bit more the but head approach but it seems to work I had 10 huge interfaces i planed to use as symbols in stead of using them as symbols i exported them in swf After that using a 3rd party programing language any OCX language dose the trick i wrote my own projector using Adobes OCX control I defined my own custom fscommands For example fscommand openLesson When the projector sees that command he unloads the OCX loads it back again and it loads the lessons swf variable transfers trough FlashVars property Unloading and reloading the OCX practically closes and reopens the virtual machine there for returning used memory to the OS I know it isn t a proper solution and probably some of you will or have come up with better ones but it works Hope this post helps somebody Best regards Brian Davis says September 5 2008 at 11 37 am the need isnâ t very high for web pages Ouch that s not right Virtual Worlds keep a browser open through several environments and many many different display objects plus I have been reading many places that different browsers respond differently to left over data of a flash instance Some will

    Original URL path: http://www.craftymind.com/kick-starting-the-garbage-collector-in-actionscript-3-with-air/ (2016-04-27)
    Open archived version from archive

  • Index of /factory/BlizzardDownloader
    Last modified Size Description Parent Directory AC OETags js 28 Jun 2008 16 36 7 9K main html 28 Jun 2008 16 36 4 2K main swf 28 Jun 2008 16 43 155K playerProductInstall 28 Jun 2008 16 36 657

    Original URL path: http://www.craftymind.com/factory/BlizzardDownloader/ (2016-04-27)
    Open archived version from archive

  • Index of /factory/FlexCustomCSS
    Description Parent Directory AC OETags js 30 Mar 2008 16 36 7 6K FlexCustomCSS html 30 Mar 2008 16 36 4 1K FlexCustomCSS swf 30 Mar 2008 16 36 154K assets 28 Mar 2008 13 26 playerProductInstall 30 Mar 2008

    Original URL path: http://www.craftymind.com/factory/FlexCustomCSS/ (2016-04-27)
    Open archived version from archive

  • Index of /factory/checkerillusion
    Last modified Size Description Parent Directory AC OETags js 23 Aug 2008 01 59 7 6K CheckeredIllusion html 23 Aug 2008 01 59 4 1K CheckeredIllusion swf 23 Aug 2008 01 59 162K history 23 Aug 2008 01 59 playerProductInstall

    Original URL path: http://www.craftymind.com/factory/checkerillusion/ (2016-04-27)
    Open archived version from archive

  • Index of /factory/cssanimation
    factory cssanimation Name Last modified Size Description Parent Directory animationtest html 05 Oct 2015 12 41 933 rift png 04 Oct 2015 23 32 958K tilefog png 04 Oct 2015

    Original URL path: http://www.craftymind.com/factory/cssanimation/ (2016-04-27)
    Open archived version from archive



  •