How to avoid uncompressing bitmapDatas multiple times

Hi,
Not sure if this should go here (performance) or IOS section, since I mainly have this issue on iOS but I think its on all air players.
When a bitmap (for exemple a bitmap in a fla) is added, you can see with Adobe SCOUT (great tool btw!) that it is uncompressed when added. Allright.
The bad thing is, if it is removed from stage, even if you keep it in memory for reuse, it is very often re-uncompressed when redisplayed. I mean 'often' because it seems erratic. If it stay removed for just a second, most of the time it won't be uncompressed again, but after 3 or more seconds, most of the time it will be (some kind of garbage collector in the "video" memory ?)
Setting its quality to lossless in the fla helps the decompression goes a bit faster (30-40 % I would say), on the detriment of swf size, but does not solve the main question : how can I force an animation (made of bitmaps for example) to never be uncompressed again as long as I dont tell it to to be "disposed" from wherever this is stored ?
Having it permanently on screen hidden somewhere is just too much a performance killer to be considered a solution when you have many. CacheAsBitmapMatrix could be usefull for vector data  on this issue (not sure), but drawing a bitmap seems a bit stupid if you do already have bitmaps.
It might not seem a big issue but in a game with effects etc. most of those will only show up once every 2 to 10 seconds, but if you loose 5ms/frame for 40 frames each time one does, and you have many, it really impact performance on devices like ios etc, whereas memory doesnt seem to be the problem here, it happens with low or high memory usage both.
If anyone knows a tip, thanks a lot!
EDIT : Tests made with gpu mode, flash builder 4.7, air 3.5, iPad3 (or other), release build.

In my experience, the second solution here: actionscript 3 - Bitmaps Being Cached As Bitmaps - Stack Overflow is the one that gave me best results thus far, even when loading a swf (as opposed to a bitmap) which contains bitmaps inside. To avoid this decompressing on the run (on demand) you can instead request flash to decompress it on load. This will increase the load time but improve the perceived performance of the app since a separate thread takes care of the decompressing. This of course means no jitter or skip when the image hits the screen:
var fileLocation:URLRequest = new URLRequest(levelToLoad);
levelToLoad = "testLevel.swf";
var levelLoader:Loader = new Loader();
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.imageDecodingPolicy = ImageDecodingPolicy.ON_LOAD;
levelLoader.load(fileLocation, loaderContext);
Embedded images (via code) are not supposed to be compressed, so this problem shouldn't occur with applications that do so. However, if you are like me, and you use the Flash Pro IDE to import PNGs or other bitmap assets, Flash Pro compresses them as JPG by default, using the setting provided by the image itself.
To fix this and avoid these decompression issues, simply go to your Flash Pro asset library, right click on the image you want to change, click on properties and select "lossless / PNG/GIF" as compression. This will increase largely the load time but you will have the much better perceived performance discussed here. This should be done in addition to implementing the code above, or it will make no difference.
In my experience the frame rate average dropped only by one frame per second, but it's much more consistent without any skips or lags which is essential for games.
See: http://help.adobe.com/en_US/as3/dev/WS52621785137562065a8e668112d98c8c4df-8000.html
And
http://www.bytearray.org/?p=2931

Similar Messages

  • How to avoid User Authentication Multiple times after run the Bo report

    Dear Experts,
    I am facing issue in BOBJ portal. we are trying to run report in portal and its working fine and running ME23N transaction from that report.
    Once we click on ME23N transacation from that report its opening new pop up window and data showing perfectly .
    But after close that pop up window and go back BO or BI TAB in portal its asking uid and password.
    But first time it's not asking. If I log out and login again then it will work but after run and close the pop up window and come back to BI or BO tab again is asking user ID and Password.
    I checked all Log on tickets and validity period and system connections every thing fine.
    Could you please Help me ...
    Regards
    Kalyan

    Hi Kalyan
    Is this any internet proxy server setting are there in browser? just bypass the proxy setting and then try the same
    BR
    SS

  • How to play one clip multiple times at the same time?

    I am writing a little game where a certain sound has to be played quite frequently. I load it as a Clip and play it with
    myClip.setFramePosition(0);
    myClip.loop(0);If the sound has to be played again but is still being played by another event, the setFramePosition() method resets the sound and the first playing instance is cut off.
    A workaround would be that each object that needs to play this sound would get its own copy, but that is not feasible due to heavy memory consumption.
    So here it goes: How can I play a single sound multiple times at the same time? Is that possible?
    Edited by: andrasz on Feb 27, 2009 12:37 AM

    If the sound has to be played again but is still being played by another event, the setFramePosition() method resets the sound and the first playing instance is cut off.
    A workaround would be that each object that needs to play this sound would get its own copy, but that is not feasible due to heavy memory consumption.
    So here it goes: How can I play a single sound multiple times at the same time? Is that possible?Ummmm, if you're using a clip, you'll have to maintain one copy per object that needs to play the sound concurrently. You could keep one master copy, and then create copies of the clip as necessary to play them, and then just dump the copies to decrease memory consumption.
    A second idea would be to write your own Clip class. Esentially, all you would need to do is dump some sound data onto a TargetDataline to play it. It'll handle the buffering and playing at the correct speed itself. If that's all you did, you should be able to dump multiple times from the same instance and play it multiple times.
    Obviously, that's just a theory. In practice, it may not work that way...

  • How to run a webdynpro multiple times by passing different parameters each time and save webpages with parameter name?

    Hi Experts,
    I am a BW consultant and new to webdynpro. Not sure how to run RSO_METADATA_REPOSITORY multiple times and by passing different parameter values each time(either taken from an a standard BW table or user provided - anything is fine) and build web pages with parameter name. Need help with direction on where to start.
    Let me step back and explain my requirement:
    In BW we have an object called transformation.
    One way of generating documentation for transformation is highlight transformation and press F1. Then its documentation will be opened as a local web page.
    I need these web pages for all transformations. This is my requirment.
    I came to know that RSO_METADATA_REPOSITORY is beeing used to generate this web page.
    The web link is something like below:
    http://ubw05.xxx.com:8005/SAP/BW/DOC/METADATA/?page=BW_O_D&SystemID=BWPCLNT100&ClassID=TRFN&ID=0KHR6J65AIIUTCJZEC093K6XDFV909PB&objectVersion=A&sap-language=EN&sap-client=100
    When i run this link seperately(not by selecting transformation and pressing F1) i need to enter login credentials to BW system.
    My challenges is how do i pass login credentials and multiple transformation IDs to generate multipe web pages with each page named by transformation ID?
    WHere to start? First of all is RSO_METADATA_REPOSITORY Webdynpro JAVA or webdynpro ABAP or can i use anything?
    Since it is beeing opened as local webpages i assume it is webdynpro JAVa is that correct?
    Thanks,
    Raghu

    hello,
    might be a problem with the version you are using.
    regards,
    the oracle reports team

  • How to insert same record multiple times in a loop..

    Dear All,
    I need to insert a record multiple time how it can be accomplish...
    eg:
    ref no name dept
    123     abc 1     
    122 def 2
    121 feg 1
    120 hhh 2
    while inserting into another table:
    all dept no 1 with should inserted 3 times for each record above
    final out put should be :
    table abc
    ref no name dept
    123     abc 1
    123     abc 1
    123     abc 1     
    122 def 2
    121 feg 1
    121 feg 1
    121 feg 1
    120 hhh 2
    Thank You

    user3029023 wrote:
    Dear All,
    I need to insert a record multiple time how it can be accomplish...
    eg:
    ref no name dept
    123     abc 1     
    122 def 2
    121 feg 1
    120 hhh 2
    while inserting into another table:
    all dept no 1 with should inserted 3 times for each record above
    final out put should be :
    table abc
    ref no name dept
    123     abc 1
    123     abc 1
    123     abc 1     
    122 def 2
    121 feg 1
    121 feg 1
    121 feg 1
    120 hhh 2
    Thank YouTry this .
    SQL> ed
    Wrote file afiedt.buf
      1  with t as
      2  (select '123' AS ref_no,'abc' AS name,'1' as Dept
      3  from dual
      4  union all
      5  select '122','def','2' from dual
      6  union all
      7  select '333','feg','1' from dual
      8  union all
      9  select '120','hhh','2' from dual
    10  )
    11  select ref_no,name,Dept from t,(select level x from dual connect by  level <4)
    12* order by 1
    SQL> /
    REF NAM D
    120 hhh 2
    120 hhh 2
    120 hhh 2
    122 def 2
    122 def 2
    122 def 2
    123 abc 1
    123 abc 1
    123 abc 1
    333 feg 1
    333 feg 1
    333 feg 1
    12 rows selected.And insert the same onto your desired table.
    Hope this Helps..
    Regards,
    Achyut

  • How to open a form multiple times

    pl tell me how to open a form multiple times

    HI Sagar,
    Before adding the form to SBO
    try to get the existing count of the form
    as shown below
    For int = 0 To objApplication.Forms.Count - 1
                If objApplication.Forms.Item(int).TypeEx = FormType Then FormTypeCount += 1
    Next
    THEN append that with your form type as shown below
    objFormCreationParams.FormType=FormType & "_" & FormTypeCount.ToString
    Then add the form to SBO
    SO every time your form is opened the unique id will like URFORMTYPE_1,URFORMTYPE_2 and so on
    Hope this helps
    regards
    vishnu

  • How to get the values multiple times for the specified element - ABAP IXML.

    Hi all,
             i have requirement to get the values for the specified elements multiple times. eg:., if the element is used in the xml 4 times then i need to get all the 4 values.  here is the sample xml,
    <View mmRelease="6.30" mmVersion="2.0" mmTimestamp="1180099591892" name="Comp_viewtestView" package="sap.com" masterLanguage="en">
    <AbstractView.InboundPlugs>
    <InboundPlug name="ip2">
    <ParameterizedFeature.Parameters>
    <Parameter name="ippara2">
    <Parameter.Type>
    <Core.ForeignReference modelName="DtDictionary" package="com.sap.dictionary" name="binary" type="DtSimpleType"/>
    </Parameter.Type>
    </Parameter>
    </ParameterizedFeature.Parameters>
    </InboundPlug>
    <InboundPlug name="hi">
    <ParameterizedFeature.Parameters>
    <Parameter name="hipara">
    <Parameter.Type>
    <Core.ForeignReference modelName="DtDictionary" package="com.sap.ide.webdynpro.uielementdefinitions" name="Visibility" type="DtSimpleType"/>
    </Parameter.Type>
    </Parameter>
    </ParameterizedFeature.Parameters>
    </InboundPlug>
    Here i need to store the following values in internal table, the element to get the values are,
    (1) InboungPlug name and the respective values of "Parameter name" and "Parameter type" name value.
    The output will be of 2 records & values should be
    Inbound plug name = ip2
    Parameter name    = ippara2
    Parameter type      = binary
    2nd record
    Inbound plug name = hi
    Parameter name    = hipara
    Parameter type      = Visibility
    These 2 records should be in internal table and then i will be passing to database table...
    Can anyone provide me the code for the above......
    Thanks in advance,
    Vishnu.

    I didn't get ur requirement..
    As per my understanding, upload the XML file into an internal table and then loop over the internal table and get the values for ptype and pname..
    XML ABAP  -  may b helpfull
    Edited by: Veeranji Reddy on May 7, 2009 2:10 PM

  • How to show the region multiple times on the same page

    Hi,
    I have a PL/SQL Dynamic Content region which creates a report with custom layout using pl/sql web toolkit. The stored procedure takes the parameter and creates report. Can I display the same region multiple times by calling it from loop with different parameter each time ?
    Thank you,
    Asha

    Hello Asha,
    In your plsql you can do a loop, so you would only have one plsql region but in there that can generate different areas of your website.
    e.g. it can loop and generate different divs or tables.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/

  • How best to set up multiple time capsules for multiple needs?

    There is so much good information on these discussions about using TCs for extenders or external drives - I am hoping to do both so will ask my own question here. BTW, this is my very first post so please be patient with me if I do not include something important.
    I have a 1/2 gen (2007) Airport extreme and a 5th gen (2011) 2 tb TC. I am buying a 6th gen (2013) 3 tb TC because I am getting the new Macbook Air and want to take advantage of the new ac wireless. I have 2 apple TVs and 1 iMac plugged directly into my home ethernet network (if I'm saying that right - they are plugged into the wall). We have iphones, ipads, and an old macbook as well that all plug in wirelessly. Below is what (I think) I would like to do in the order I think I would have to do it. Could you help me understand if (a) this makes sense, and (b) if so, how do I accomplish these steps?
    1. I unplug the 2 old units (2007 and 2011) and set them aside for the moment.
    2. I plug in the new 6th gen TC to my modem and follow set up instructions to make it my backup area for iMac, Air, and old Macbook. I assume I need to do this because I want it to be the primary right?
    3. I want to use the 2011 TC as a hard drive - I will be transferring all photos and 2 iTunes libraries (mine and my husband's) to it. We watch lots of movies so that is the main use. I think I would want this plugged directly into an ethernet port in the wall so it will be quickest for Apple TVs to access right? Or would it be better (fastest access) to connect it directly to the new TC or even the iMac? Is there something I need to do to make it an external drive rather than TC?
    4. I would also, if possible, like to use the 2011 TC as an extender into a far room in the house. Could I simply plug it into an ethernet port in that room and it magically becomes an extender too? Would this not be ideal for some reason, like it is slower to access? Note that this is not terribly necessary but would be nice if easy.
    6. Would it make sense for me to plug in the 2007 unit in a far room upstairs to serve as an extender up there?
    Thank you so very much in advance.

    There are a few things to get straight..
    This is pedantic but heck I post too much..
    The Gen of the TC is one behind the Extreme.. so a Gen6 AE = Gen5 TC.
    Totally pedantic.. but it keeps me happy.
    3. I want to use the 2011 TC as a hard drive - I will be transferring all photos and 2 iTunes libraries (mine and my husband's) to it. We watch lots of movies so that is the main use.
    I would like you to rethink this.
    You can do it.. but I think you are misunderstanding how iphoto and itunes work.
    Your Apple TV never connects to the library of itunes..
    And
    Your TC is not a media player.
    So all files stored on a TC are going to flow like this..
    TC(ituneslibrary)---Computer (itunes)---stream---TC(network)----ATV.
    If you remove the computer.. then you have nothing.
    The TC is not a great place to store the itunes library for the following reasons.
    It is slow.. much slower than local hard disk.
    It is slow to spin up .. causing itunes issues with losing the library.
    It is fast to spin down.. so streams get lost.
    It has no backup.. and Time Machine cannot backup network drives. That means one day you will wake up.. TC will be dead.. (they do not last forever so this is 100% certain to happen).. And your library is gone. Apple offer no recovery service.. and it costs a small fortune to recover files.. without any guarantee of success.
    iphoto is even worse.. it is strongly recommended NOT TO USE NETWORK to locate the iphoto library. It corrupts easily and a small corruption makes the entire library unreadible.
    Since you have imac it is better to use an external drive for libraries.. use the fastest port available and you can afford.. ie Thunderbolt>USB3>FW800>USB2
    Only the very latest Macs have USB3 but it kills the earlier USB2 and Firewire. And for many people will be as fast as Thunderbolt which is the tops but uber expensive.
    Then the TC serves its correct function as TM backup.
    You can share this hard disk to the network if you want other computers to access it.
    You can store multiple iphoto or itunes libraries on it.
    Follow the specific instructions about sharing your itunes library.
    http://support.apple.com/kb/ht2688
    http://www.apple.com/au/support/itunes/library/
    And your iphoto
    http://support.apple.com/kb/HT1198
    Most of the rest is fine..
    1. Yes.
    2. Yes.
    4. Yes you can extend with the old TC. Ethernet would be better. You might be mixing up wireless extend with Roaming.. you can use roaming if you have ethernet already available.
    http://support.apple.com/kb/ht4260
    6. Yes.. you can use a number of units via ethernet as AP points.
    5. For another life??

  • How to shedule process chain Multiple time in a month

    Hi to all,
    I have a question.
    suppose we required to shedule the process chain,
    for first 10 days, we need to extract data 8 time a day
    and for remaing days in months, we need to extratc data 1 time a day.
    How can we achive that in process chain.
    Please can any one tell me the solution.
    I shall be thankful to you for this.
    Regards
    Pavneet rana

    Hi,
    Another option would be using the InfoPackage settings. Create 2 infoPackages.
    1st one for first 10 days
    ====================
    In the "Schedue" tab, define the Scheduling options to Hourly and save it. Now, you will see "Periodic Processing" section with two options,
    1. Do Not Cancel Job
    2. Cancel Job After X Runs
    For 2, provide 8.
    2nd for From 11th day
    ==================
    Create another InfoPackage for Daily load.
    In process Chain, you may use the previous "Decision Between Multiple Alternatives" process type (in the command formula, write a simple formula as below:
    RIGHT( 2, Current Date ) <= 10
    Then include 2 ABAP Program for each option (using "BAPI_IPAK_START" with the InfoPackage name) in decision options. (use the InfoPackages as variants).
    This will solve your requirement,
    "for first 10 days, we need to extract data 8 time a day
    and for remaining days in months, we need to extract data 1 time a day."
    Now, further update using DTP, for remaining days in months (i.e. 1 time a day) you can directly include the DTP in the chain. However, for the 1st 10 days you have to dig more.
    Good Luck!
    Sankar Kumar

  • How to use a variable multiple times in the data flow

    DECLARE
    @StartTime datetime,
    @EndTime datetime
    SET @StartTime = (SELECT MAX(AvailDateTime) FROM dbo.Fact)
    SET @EndTime = (SELECT MAX(AvailDateTime) FROM dbo.Product);
    --DATEADD(day, 1, @StartTime);
    --PRINT @StartTime
    --PRINT @EndTime;
    WITH
    dates AS (
    SELECT DATEADD(Minute,5,@StartTime) AS [date]
    WHERE DATEADD(Minute,5,@StartTime) <= @EndTime
    UNION ALL
    SELECT DATEADD(minute, 5 ,t.date) AS [date]
    FROM dates t
    WHERE DATEADD(minute, 5, t.date) <= @EndTime
    I have the above sql, in this I'm using the 2 variables and calling @Starttime Variable couple of time. How should I build the SSIS package based on this query? how can I call the same variable in different place? how will SSIS take it?
    Thanks

    Since you have the variables set in code you just can place this code into the SQL code section of say an OLEDB source
    like there
    or

  • How do you set up multiple time capsules in my home?

    I have one time capsule for my information and my roommate has another.  They are in the same room.  How do I set them up so our information doesn't get confused?

    I doubt you will have confusion.. if they have different names.. then network wise they will be fine.
    ie You set up your TC named TCTom / TCJulia.. and the other person has his/her TCHarry / TCHarriet.. then clearly they are different..
    You can have wireless issues though. If they connect via the same network.. then use ethernet and turn off wireless. Or make a pact and share wireless on one. ie the TC can be plugged into each other.. but wireless only working on one.. they will both be equally accessible and work equally well.

  • How to call BADI Triggering Multiple Times

    Hi ,
        I got one requirement of Duplicate check for that i implemeted one BADI  in that i called Duplicat check function Module also so when i entered first, last and email id it is giving the message as Data is saved. when i entered the same data is entered it gives the message as Account is Duplicate and it wont save at that time when i modified the data then it wants to save that means it wants to call the duplicate check badi once again but thing is it wont save again it is giving the message as duplicate so for each change the badi wants to trigger agin and again but it wont so how can i do this one pls tell me which badi is suitable
    Regards
    Ravi

    I think you can do it by using the same BADI. you can just create a static data to keep the first, last and email id. If the first, last and email id are the same skip the duplication check.
    for examples:
      Method badi.........
        STATICS static_name TYPE name VALUE 10.
        IF static_name is initial.
          static_name = im_name.
          perform duplicate_check.....
        ELSE.
          if static_name ne im_name.
            perform duplicate_check.....
          endif.
        ENDIF.
      Endmethod
    Cheers,
    Chaiphon

  • Import/exporting uncompressed video multiple times

    Hi guys I'm running FCP version 5. I want to use a plugin called NeatVideo to remove grain from my footage however it is not compatible with FCP 5. My friend has FCE 4, which NeatVideo is compatible with.
    The question is, if I export my film from FCP 5 as an uncompressed.mov, import this into FCE, add the plug in, and then export from FCE again uncompressed, and then reimport into FCP once more to get it ready for my final export for DVD SP, will all these imports/exports result in a loss of quality?
    My guess is no since it will be uncompressed? If so how to I prevent any loss of quality? Do I have to set the FCE project settings as uncompressed also?
    I'm kinda new to all this so your help will be much appreciated!
    Thanks. T

    Quick question Jim,
    How do you make a 'file recognition' import to another version of FCP or FCE which is installed on a completely different PowerMac?
    Is it simply exporting it as uncompressed - which the new FCP/FCE will recognize?
    Also when it is imported into the new FCP, will have I have to set the project settings 'Compression' to 'Uncompressed' also to ensure it remains the same quality without further compression?
    Thanks. T

  • Avoid Joining Table Multiple Times

    I have two tables EMPLOYEE and EMPLOYEE_HOURS.
    EMPLOYEE contains EMPLOYEE_ID
    EMPLOYEE_HOURS contains EMPLOYEE_ID, HOURS, TYPE
    So the EMPLOYEE_HOURS table will contain multiple entries for a given period with hours for types 1, 2 and 3.
    I need to display all this on a single line. My query today is
    select e.employee_id, eh1.hours, eh2.hours, eh3,hours
    from employee e
    inner join employee_hours eh1 on e.employee_id = eh1.employee_id and eh1.type = 1
    inner join employee_hours eh1 on e.employee_id = eh1.employee_id and eh1.type = 2
    inner join employee_hours eh1 on e.employee_id = eh1.employee_id and eh1.type = 3This only works if I know the number of types and their codes. I know I could create a procedure and build the query dynamically, but I’m wondering if there’s some other SQL and/or PL/SQL that can handle this in a single query?
    Thanks,
    Mark

    If you don't know the number of codes in advance, then you don't know the number of columns in the result set in advance. Since a single SQL statement cannot return different numbers of columns on different executions, that almost always means that you need to use dynamic SQL to generate the SQL statement at runtime. It is possible, as well, to write a generic pipelined table function that returns a different number of rows but that is generally vastly more complicated (there have been examples posted here in the forums if you really want to go down that path).
    If you know the number of codes (or you can return a fixed number of columns that is known in advance), you don't need to know the individual code values
    SELECT employee_id,
           MAX( CASE WHEN rnk = 1 THEN hours ELSE null END) hours_1,
           MAX( CASE WHEN rnk = 2 THEN hours ELSE null END) hours_2,
           MAX( CASE WHEN rnk = 3 THEN hours ELSE null END) hours_3
      FROM (SELECT employee_id, hours, rank() over (partition by employee_id order by type_id) rnk
             FROM employee)
    GROUP BY employee_idJustin

Maybe you are looking for

  • Strange issue with Lync 2013 Front end pool and UC Endpoints.

    I have two servers in a Lync Pool. S1 and S2.  I also have an ACD server that has Trusted endpoints within Lync. With both servers running, if a call is answered by S2 there are a bunch of weird delays in transfers.  IF I shut down S2, everything wor

  • I used this process on 4/20/2014.  Is there a service person to help reinstall trial 8.1 crash?

    I need help to reinstall PS trial on PC computer running Windows 8.1.  PS installed 4/17, ran in in degraded mode until it crashed 4/19.  Recovery back to 4/16 did not include PS trial.  I want to use this trial to know if it even runs on Windows 8.1

  • Render needed after capture?

    I've just captured footage off a Canon XH A1 that was shot in HD but I down converted in the camera before capturing, as I don't have an HD setup. The footage looks fine but when dragged to the timeline all needs rendering (orange). Why? I have 4 hou

  • Advise me on my Kinetic Typography Video

    I want to make a motion-typography video with a lot of zoom-outs.  I'll be using cameras to accomplish this. Should I make a huge composition to start and use that?  Can I output it at 720p if I do so?  Do you think I should just scale the text down,

  • Computer won't boot with R9 270X Hawk installed.

    It ran ok with a previous Hawk card, but that failed after 6 months and the problem I have is with the replacement supplied under warranty. The computer will not boot at all with the card installed. It runs fine with an ATI Radeon HD6450 in the PCI-e