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".
  • Come see my talk about memory management at Max 2009 | Craftymind
    ll be going more indepth on memory techniques as well as how to profile your apps As with all my sessions you can be sure there ll be plenty of code handed out by the end My session will be running on Tuesday at 1 30 PM and again on Wednesday at 5 00 PM hope to see you all there Post navigation Previous Post 360iDev session materials on Quartz 2D Next Post Blowing up HTML5 video and mapping it into 3D space 4 thoughts on Come see my talk about memory management at Max 2009 Chris Nunciato says August 25 2009 at 7 23 pm Your talk last year was excellent so I ll be there Jeff says October 26 2009 at 10 15 am Sean I ve had a look through your slides for your Max 2008 talk really really good stuff I ve been looking for materials from your Max 2009 talk with no luck so far are those materials available Jeff Sean Christmann says October 31 2009 at 11 40 am Jeff I ended up with swine flu this year and didn t make it to Max Jon Campos and Jun Heider ended up filling the

    Original URL path: http://www.craftymind.com/come-see-my-talk-about-memory-management-at-max-2009/ (2016-04-27)
    Open archived version from archive

  • Max 2008 session material | Craftymind
    interested in the section on the rendering pipeline in the Flash Player Any chance you can post your source code for the demo s you did The red and blue display objects I work on render intensive games built in Flash and I d love to see how you were able pull off the optimizations in the compositing phase Sean Christmann says November 21 2008 at 6 16 pm Thanks Jason Regarding the rendering example I may have to narrow the parameters for when rendering to a single Sprite gives an advantage over rendering to multiple ones I found a problem in my code with the help of a co worker and I m in the process of reworking the example to give a more meaningful result ë ìž ê says November 27 2008 at 8 50 pm wow thanx for your document Minh says January 13 2009 at 10 12 am Hey Sean just watched your presentation on tv adobe com Can you post the source code to all the examples during the presentation Stan Reshetnyk says January 29 2009 at 4 26 pm Hi Intresting to know why Avoid databinding on data transfer objects or AMF objects is not good Sean Christmann says February 9 2009 at 2 42 am Stan I suggest this limitation because you ll spend alot of cpu time dispatching events before anyone s ready to listen to them as the object is being deserialized Plus typically with an AMF or data transfer object you ll be switching out the entire object result set in memory which would only require top level binding on the value you re changing in your data model A top level binding will trigger your entire binding chain anyway Manfred Karrer says April 26 2009 at 5 41 am

    Original URL path: http://www.craftymind.com/max-2008-session-material/ (2016-04-27)
    Open archived version from archive

  • Flash | Craftymind | Page 3
    engineers are able to speed up their technology of choice Although the code is fairly simple at a glance there are no easy optimization paths to be found and no cheating by turning off anti aliasing Results Results for Win XP running on Macbook Pro Intel Core 2 Duo 2 33 GHz Tech Base Version Average FPS Source Browser HTML 28 36 IE 7 Download SVG Canvas Flash Flex 3 46 08 Download Flash 9 Java Java 5 Swing 19 37 Download Java 6 Swing Processing JavaFX Silverlight Silverlight 1 Javascript 9 12 Download Silverlight 2 Beta C 7 95 Download Results for OS X 10 5 running on Macbook Pro Intel Core 2 Duo 2 33 GHz Tech Base Version Average FPS Source Browser HTML 18 20 Safari 3 Download SVG Canvas Flash Flex 3 8 01 Download Flash 9 Java Java 5 Swing 7 19 Download Java 6 Swing Processing JavaFX Silverlight Silverlight 1 Javascript 5 25 Download Silverlight 2 Beta C 5 38 Download Findings I ve been surprised with the results so far between WinXP and OS X On the same machine its very clear which vendors take more advantage of the underlying hardware The results for the different plugin technologies aren t too surprising since it s regularly admitted that most companies spend their optimization time on Windows due to its larger install base This argument doesn t hold any water though when comparing html rendering on Safari Mac against IE Windows where there s roughly a 1 6 1 advantage to the IE team I can t help but wonder if the core apis on the Mac platform are creating any unnecessary roadblocks I m also extremely surprised at the rendering speed that Flash is able to pull off on Windows I developed this benchmark under OS X and after compiling the results I m considered making the testcase more intensive since Flash is running so fast but for now maybe the really poor Mac performance will give Adobe something to work on You can read more about rendering engine theory the structure of the test case itself and detailed analysis of the results on the sub pages within the site Updates John Dowdell from Adobe brought up a valid point that plugin vendors are restricted by the browser environments they run in This is true to an extent but the limitations enforced on plugins don t come into play with the GUIMark test Browsers typically restrict the number of event loops available to a plugin which caps the framerate to around 40 50 fps GUIMark doesn t come anywhere close to hitting that limit on Mac There are also no restrictions to the amount of cpu available to a plugin running within the browser which is why all of them peg the cpu to 100 To illustrate the point I created an AIR implementation of GUIMark and ran it on my Powerbook and here are the results I got The Flash players rendering

    Original URL path: http://www.craftymind.com/category/flash/page/3/ (2016-04-27)
    Open archived version from archive

  • Actionscript 3.0 prototyping, viable but costly | Craftymind
    example I was able to create in Flex Sprite prototype spriteHelper new SpriteHelper Sprite prototype rotateTo function deg int void var sh SpriteHelper this spriteHelper sh target this sh rotateTo deg package import flash display Sprite import flash events TimerEvent import flash utils Timer public class SpriteHelper public var degreeTo int 0 public var degCount int 0 public var degTimer Timer null public var target Sprite public function rotateTo deg int void degreeTo deg degCount 0 degTimer new Timer 10 degTimer addEventListener TimerEvent TIMER doAnimateRotation degTimer start public function doAnimateRotation event TimerEvent void degCount if degCount 40 target rotation degreeTo degCount 40 else degTimer removeEventListener TimerEvent TIMER doAnimateRotation degTimer null mx Box id myContainer backgroundColor FF0000 width 100 height 100 right 40 y 0 creationComplete myContainer rotateTo 50 Youâ ll notice 2 things in the implementation here Since Sprite is a statically defined class accessing the prototype chain requires bracket syntax ala myContainer â rotateToâ 50 and secondly most of the functionality of rotateTo has been moved into a separate class The reason for the latter point is because accessing the prototype chain is costly as it has to recurse through the inheritance chain until it finds the class with

    Original URL path: http://www.craftymind.com/actionscript-30-prototyping-viable-but-costly/ (2016-04-27)
    Open archived version from archive

  • Flash | Craftymind | Page 4
    for those who don t know what the Bubblemark test is its a simple animation test case implemented in different GUI frameworks its kinda like an Acid2 test for rendering speed The charts should ideally give you a base number to understand how well one technology compares against another for rendering As a GUI developer I ve been a bit underwhelmed with the whole thing and heres why The author doesn t understand Flash s rendering engine The easiest way to illustrate how incorrectly the Flash test was designed is to download the source and change the compiled framerate to 1 fps Re compile and run the test and you ll notice the benchmark framerate running at 50 fps You can clearly see the balls only moving once per second yet the test thinks its flying along This is because the testcase makes the incorrect assumptions that changing the properties of a DisplayObject causes it to render right away The reality is Flash holds on to all display updates till the next render pass and applies all the latest changes at once Changing the position of an object every 5 milliseconds is meaningless when Flash is bound by a 33 millisecond render pass or whatever you re framerate divided by 1000 happens to be A correct test case would rely on an ENTER FRAME handler to change x and y values and get rid of any Timer calls Framerate tests above 60 fps are meaningless Seriously any GUI benchmark designed to test above 60 fps is bogus In fact a pretty simple optimization technique for Adobe or Sun would be to cap the paint requests that get forwarded to OS X or Windows simply because the majority of computer users these days are on LCD panels which natively run at 60 fps Some operating systems even go a step further and limit the effective framerate of paint requests it sends to the videocard see Beam Sync on Mac So when you see the Java test case fly up to 120 fps on Bubblemark you can realistically only see 60 of those frames and there might be a chance the other 60 are never even calculated by Javas layout engine The test just moves balls around This is my biggest beef with the benchmark because it only tests one simple aspect of the rendering engine in these technologies which is bitmap translation How do bitmaps moving around the screen tell you anything about the capabilities of the respective technologies Do the JavaFX guys really think optimizing this usecase will make their technology relevant The only thing Bubblemark will tell you is which runtimes might best handle bitmap particle emitters thats about it Theres a lot more that goes into both the layout engine and the rendering pipeline of these different technologies and its a shame that only the most basic aspect is being tested The funny thing is if you open up your task manager while running the tests you ll notice that several of them don t even try to run at full speed my CPU is sitting as low as 20 in some cases This means the runtimes don t even consider the test difficult enough to give it full attention and have opted for using less power over faster motion I don t mean to cut down the developers responsible for Bubblemark because at least they came up with a simple way to help us all compare these different technologies I just think its a bit misguided to put any meaning behind these numbers When evaluating your options for a GUI framework in our flashy web 2 0 world you need to consider how well a technology can handle object scaling alpha transparencies rotations text reflow along with basic x and y translation and dynamic redraws Even more realistically developers need to be aware of the limits in the 25 45 framerate region since this is where you can efficiently balance render complexity with smooth animation I ve uploaded a couple quick test cases in Flash HTML and Silverlight that I think provide a good foundation for stressing a rendering engine and hopefully I ll get a chance to expand them more into a full test suite AIR Flash Flex Kick starting the garbage collector in Actionscript 3 with AIR April 9 2008 Sean Christmann 31 Comments During the final months of my work with eBay Desktop my sights were set squarely on optimization both memory and cpu When it came time to start messing with the garbage collector my sanity went from bad to worse What I originally thought was going to be a straightforward way of releasing memory in AIR turned into a 2 month long testcase with some discouraging outcomes Memory usage in eBay Desktop was something that always lingered in the back of my mind during the entire development cycle Because of the shifting nature of our requirements the issue was only explored near the end even though we knew in the beginning that memory usage had to go through valleys and peaks in a managed way while users spent time in it throughout the day We had alerts that would open and close we had an app that would run in the system tray and we considered making a lite mode that would sit on top of your desktop all day each of which had different memory requirements In the beginning we used a well known hack to test garbage collection until part way through the development of AIR and Flex 3 Adobe finally added support for calling the garbage collector directly We knew at this point we had a viable route for managing memory since Adobe was now making the effort to acknowledge the need So now all that was required was a simple call to flash system System gc and we were set to go right Well not exactly First off we learned that a call to System gc only does

    Original URL path: http://www.craftymind.com/category/flash/page/4/ (2016-04-27)
    Open archived version from archive


  • new Array private var e Array new Array protected function init void chartXSpread chartWidth totalMinutes chartYSpread chartHeight highestStock meter new FPSMeter addEventListener Event ENTER FRAME processFrame protected function processFrame evt Event void create background draw clear draw lineStyle 1 0x666666 var xCoord Number var yCoord Number for var x Number 0 x 1 stock bottomData i xCoord stock minute chartXSpread yCoord chartHeight stock value chartYSpread draw lineTo xCoord yCoord else clamp fill to bottom of chart draw lineTo chartWidth chartHeight draw lineTo 0 chartHeight draw endFill protected function updatePerformance void meter increment fps text Current meter getFramerate fps if testRunning continueTest private var testBegin int 0 private var testData Array private var testRunning Boolean false private function startTest evt MouseEvent void testBegin getTimer testRunning true testData results text Running private function continueTest void var time uint getTimer testData push time if time testBegin 10000 testRunning false var output Number testData length time testBegin 1000 results text Test Average FPSMeter formatNumber output fps private function createChildren void var header Sprite new Sprite header graphics beginFill 0xC0C4DF header graphics drawRect 0 0 1200 30 addChild header var title TextField createTextField GUIMark Vector Chart Test title width 300 title x 4 header addChild title var button Sprite createButton button x 320 button y 7 button addEventListener MouseEvent CLICK startTest header addChild button fps createTextField fps width 140 fps x 405 header addChild fps results createTextField results width 300 results x 555 header addChild results var canvas Sprite new Sprite canvas x 0 canvas y 30 addChild canvas draw canvas graphics private function createTextField val String TextField var txt TextField new TextField txt y 6 txt defaultTextFormat new TextFormat Arial 15 0x000000 true txt text val return txt private function createButton Sprite var buttonText TextField new TextField buttonText x 7 buttonText y 1 buttonText

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


  • explosion e f04 png private var Bomb4 Class Embed source assets explosion e f05 png private var Bomb5 Class Embed source assets explosion e f06 png private var Bomb6 Class Embed source assets explosion e f07 png private var Bomb7 Class Embed source assets explosion e f08 png private var Bomb8 Class public function FlashGamingTest stage scaleMode StageScaleMode NO SCALE stage align StageAlign TOP LEFT createChildren init private var fps TextField private var results TextField private var draw Sprite private var meter FPSMeter private var monsters Array private var explosions Array flash draw layers private var tower Bitmap private var towerTop Bitmap private var lasers Sprite private function init void var eastWalk Array new EnemyEast1 new EnemyEast2 new EnemyEast3 new EnemyEast2 var southWalk Array new EnemySouth1 new EnemySouth2 new EnemySouth3 new EnemySouth2 var westWalk Array new EnemyWest1 new EnemyWest2 new EnemyWest3 new EnemyWest2 var northWalk Array new EnemyNorth1 new EnemyNorth2 new EnemyNorth3 new EnemyNorth2 var R Number Math PI 180 for var i int 0 i 45 angle 135 angle 225 angle 1200 fb x 1240 if fb y 600 fb y 640 fb increment if fb y 10000 testRunning false var output Number testData length time testBegin 1000 results text Test Average FPSMeter formatNumber output fps private function createChildren void var header Sprite new Sprite header graphics beginFill 0xC0C4DF header graphics drawRect 0 0 1200 30 addChild header var title TextField createTextField GUIMark Bitmap Game Test title width 300 title x 4 header addChild title var button Sprite createButton button x 320 button y 7 button addEventListener MouseEvent CLICK startTest header addChild button fps createTextField fps width 140 fps x 405 header addChild fps results createTextField results width 300 results x 555 header addChild results draw new Sprite draw x 0 draw y 30 draw scrollRect new Rectangle 0

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


  • Ñ Ñ Ð Ñ Ð Ð Ð²Ñ Ð¾Ñ Ð Ð Ñ Ð Ð½Ð Ð Ð ÐµÐ Ð Ñ Ðµ Ð¼Ñ Ð¾Ð Ð Ð Ñ Ñ Ñ Ð Ð²Ñ ÐµÐ³Ð Ð Ð¾Ð Ñ Ð Ð Ð¾Ð²Ð Ð½Ð Ðµ n private var japanese String ã ã ã ã è ã ã ã ã ã ã ã ã è äº ã ã ã ã ã ã ã ã å ã ã ã ã ¾ã ã çµ é ã ã ã ã ¾ã ã ã ªã ã ã ã ã ã ã ã ã ã ¹ã ã ã ã ªã ã è ªå ã ã ã ã ã ã ã ¼ã ã 㠳㠳ã ã ³ã ã ã ã æ ç ã ã ã ã ã ã ã ã ¾ã ã ã ã ã ã è ã ã ã ã ã ã ã ã è äº ã ã ã ã ã ã ã ã å ã ã ã ã ¾ã ã çµ é ã ã ã ã ¾ã ã ã ªã ã ã ã ã ã ã ã ã ã ¹ã ã ã ã ªã ã è ªå ã ã ã ã ã ã ã ¼ã ã 㠳㠳ã ã ³ã ã ã ã æ ç ã ã ã ã ã ã ã ã ¾ã ã è ªå ã ã ã ã ã ã ã ¼ã ã 㠳㠳ã ã ³ã ã ã ã æ ç ã ã ã ã ã ã ã ã ¾ã ã ã ã ã ã è ã ã ã ã ã ã ã ã è äº ã ã ã ã ã ã ã ã å ã ã ã ã ¾ã ã çµ é ã ã ã ã ¾ã ã ã ªã ã ã ã ã ã ã ã ã ã ¹ã ã ã ã ªã ã è ªå n private var textblock1 TextField private var textblock2 TextField private var textblock3 TextField private var textblock4 TextField private var textblock5 TextField protected function init void textblock1 createColumnField 0 0 200 300 Champignon textblock1 text concatStr english 60 draw addChild textblock1 textblock2 createColumnField 0 300 200 300 Starjedi textblock2 text concatStr english 60 draw addChild textblock2 textblock3 createColumnField 200 0 800 600 sans textblock3 text concatStr english 60 draw addChild textblock3 textblock4 createColumnField 1000 0 200 300 sans textblock4 text concatStr russian 60 draw addChild textblock4 textblock5 createColumnField 1000 300 200 300 sans textblock5 text concatStr japanese 60 draw addChild textblock5 meter new FPSMeter addEventListener Event ENTER FRAME processFrame protected function createColumnField x Number y Number width Number height Number font String TextField var txt TextField new TextField if font sans txt embedFonts true txt multiline true txt wordWrap true txt border true txt x x txt y y txt width width txt height height txt defaultTextFormat new TextFormat font 14 0x000000 return txt protected function concatStr str String num int String var out String str var i int 0 while i 10000 testRunning false var output Number testData length time testBegin 1000 results text Test Average FPSMeter formatNumber

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



  •