Tips to Speed up drawImage

My simple array based map game has significant slow down. I profiled it and 85% of my cpu time comes from one line of code. Namely:
g.drawImage(this.img, x * this.w, y * this.w, null);
The img field is a BufferedImage derived from a .png with no alpha channel. The dimensions of the image and the painting area are identical. I'm running linux and when this program is run, xorg consumes 50% of my cpu.
Are there any tips to significantly speed up the painting of image files?

1. Your description is vague. If you are calling this in a loop, call drawImage once, and copyArea to copy it otherwise. You may also want to consider using TexturePaint to do this.
2. Make sure your image's format is compatible with your monitor's configuration:
BufferedImage original = ...
GraphicsConfiguration gc = component.getGraphicsConfiguration();
BufferedImage compat = gc.createCompatibleImage(original.getWidth(), original.getHeight());
Graphics2D g = compat .createGraphics() ;
g.drawRenderedImage(original, null);
g.dispose();Now use compat instead of original.

Similar Messages

  • Quick Tips For Speed Your Digital Publishing WorkFlow

    I think that we have a great problem with our Digital Publishing Workflow's speed . I talk about, for example, of set up State Objets Sliedshows for multiple page, and I mean, there are another similar examples about that. Do you know if does exist more tips for speed our workflow in InDesign for Digital Publishing Output?
    Thanks a lot!
    Sorry for my bad english.
    Bye!
    Marco Toscano

    Muito abrigado my friend!  Seriously thanks a million, but I was curious to know about my situation regarding replacing my first shot multiple times... In another words there's a clip already in the storyline which won't allow me to replace edit since it just moves out of the way.  Would you just go back into the browser and add the original selection to the first clip?  Because I kept having to move my connected music and solid I just gave up and would wait until the end to add the music and solid (I add the solid to give the background a different color when I want to create the letterbox effect). 
    I just watched a music video tutorial where someone created a 3 minute solid, made like a hundred cuts with the blade tool and manually dragged each clip from his browser to replace from start for each of those cuts in the solid...
    What is your workflow for music-based edits?  Do you place the song in the primary story line and use the video as connected clips?  Do you use a solid or gap clip and dissect it with cuts and replace the segments with clips? I really hate not being able to add markers to the timeline and must make those marks on a clip/generator/music track of some kind.  Also if you have a project that has the same settings with fps, crop size, solid as a background is there a way to make template so I don't have to do that each and every time?
    Thanks again my friend!!!
    Anthony

  • Tips for speeding up data merge

    Hi there,
    I have a seven page indesign file with around 20 data merge fields and 8 custom conditions I either enable or disable. I am trying to generate preview JPG's as quick as possible that render to the users browser.
    It takes around 1.7 seconds for a preview to go to the browser with around 0.5 seconds of that time used in the data merge process.
    Are there any tips / tricks I can use to speed up this process.
    Dustin

    Hi Dustin,
    Sure and right,
    but you are running for miliseconds and it depends on details where devil use to sleep.
    So better way is to discuss details.
    For general example: real speed up is to process with arrays instead of collections
         (doc,pages.everyItem().textFrames.everyItem().getElements() vs doc,pages.everyItem().textFrames)
    but it would do not matter if your workflow is set with network connections.
    Jarek

  • Tips to speed up my imac

    recently I installed more RAM, up from 1GB to 3GB.
    I frequently work in photoshop, indesign, and other apps at the same time, same project so I'll have other apps open, including internet browsing.
    i've still noticed i get the pinwheel alot more than i would like.
    I checked the Activity Monitor. At the time I had some free space, and I think 3mb page outs.
    it's an iMac6,1. I believe i got it in 2007. I'd like to get a few more years before upgrading.
    I have Snow Leopard operating system. version 10.6.8. I do all the updates.
    should I go up to 4GB RAM? are there settings that I can check that will increase my computers speed? I try not to have apps running that I'm not using.
    will getting rid of software I don't use help with speed? will storing files to dropbox help with speed?
    thanks.
    kathy

    There is not much you can do at this point.
    Your model iMac maxes out at 3 GBs.
    You simply haven't got enough physical RAM to run OS X and all of the apps you have running simultaneously.
    OS X, by itself, can use up between 2-4 GBs of RAM. You only have 3 GBs of RAM. So, already that puts your iMac at a disadvantage as it doesn't leave very much RAM to run other applications.
    Also, if you are starting to get low on hard drive space (25 GBs or less), this can cause slowdowns with your iMac,too!
    It maybe time to consider getting an external hard drive to store your important data to locally. Do not just rely on Cloud services to store your important data. You should have some sort of secure, local storage for your data.
    Then you can delete some of this data off of your internal drive, freeing up additional hard drive space.

  • Slow Rendering...Any tips on speeding it up?

    After dealing with a bag full of issues with my G5, I have replaced my system drive, replaced 2 1gig sticks of RAM that was defective and have upgraded to the latest version of FCP studio crossgrade. Now I am back to editing a documentary I started before I had all those issues. I am noticing the rendering seems real slow compared to how it was before the issues. At first I only noticed this with the RED bars but today I learned that the ORANGE bars are slow to render too! It always took about a minute or under for most things to render on my machine. Now its taking up to 10 minutes! The GREEN bars render out in no time...super quick.
    I have my timeline set to UNLIMITED RT. I have 2.5 gigs of ram in my machine. Is there a setting that I may have overlooked that I need to set to speed up the rendering time? I had to put a fresh copy of FCP studio on my new hard drive so I had to do the settings all over again and may have overlooked something.
    Thanks!

    *Sorry, I just looked at your OP again, where you mentioned you have Unlimited RT set. So everything I wrote below probably won't apply. But I would still double check your RT render settings. Maybe something is getting rendered that wasn't before. Also, if you're bringing in clips that were not captured in FCP, transcoding from anoter codec would slow things down. (such as Avid or iMovie's dv stream format)**
    Disregard this if you're already aware, but here's how the color bars work. They're actually an indicator of your system's ability to play realtime effects (without rendering). A dark green bar means a clip is rendered. A light green bar means your system will have no problem playing that effect back at full speed. An orange bar indicates probable dropped frames or slowdown through playback. A red bar obviously means that the effect cannot be played in real time and needs to be rendered. Whether or not your system is able to play something back depends entirely on the power of your hardware. More ram, a better video card, or video effects card all effect real time playback.
    Final Cut has the option to switch between Unlimited Real-Time (RT) and Safe RT. Safe RT will only limit realtime playback to those effect it knows it can play safely, and ask you to render everything else. Full RT will attempt to play any realtime capable effect back in realtime.
    When an effect is played back in realtime, it may gracefully degrade the quality of the clip as needed in order achieve full speed, and can result in a somewhat poorer looking image. If you want to make sure to see your video at absolute best quality, always render before playback, even if the bar is light green (you may need to tell FCP to specficially render light green bars under the render menu).
    So what does this all have to do with your problem? I suspect in the past your machine was trying to handle as much playback in real time as possible and did not require you to render as often, or as much. This is why you may never have seen the dark green bars. You may have switched to Safe RT or no RT which is asking you to render more. There is menu for RT playback in the upper right corner of the Timelie window.
    Just a hunch, hope it helps. (Also hope I got all the RT mumbo jumbo right, its been a few months since I've gotten to sit down at an FCP machine).

  • Office for Mac 2011: Tips for speeding up Word when using tracked changes and comments?

    I run a fresh installation of Office for Mac 2011 (v. 14.4.1) on a brand new Macbook Pro 13" Retina 2.4GHz with 16GB RAM running 10.9.2. The Office package is fully up-to-date.
    I mainly use Word and find that it is extremely slow when I track changes. Documents need not be particularly large - even in a 30-page document after a few pages of tracks typing becomes a pain, in particular in comment bubbles where the text shows up letter-by-letter and only finish several seconds after I've stopped typing. Other programs run at the same time do not suffer from this horrible lag.
    I have searched and seen that this is not uncommon so it appears that Microsoft's coders are not particularly well versed in coding for Mac.
    My question is if other users have found ways to improve the situation, for instance by trashing plists or something like that? This is really driving me crazy
    Many TIA
    Philip

    You might try looking/posting here.
    Microsoft Support – Office for Mac
    Microsoft Support – Office for Mac (2)

  • Does anyone have tips on speeding up my mac osx?

    I have had it since 2009 and I know I need to get an external hard drive to back it up. In the meantime though, is there anyway I can "reformat" or filter out the junk?

    Well, you do want a backup ASAP, you can't really format without losing everything you have now, but...
    See if the Disk is issuing any S.M.A.R.T errors in Disk Utility...
    http://support.apple.com/kb/PH7029
    Open Activity Monitor in Applications>Utilities, select All Processes & sort on CPU%, any indications there?
    How much free RAM & free Disk space do you have also, click on the Memory & Disk Usage Tabs.
    Open Console in Utilities & see if there are any clues or repeating messages when this happens.
    In the Memory tab of Activity Monitor, are there a lot of Pageouts?

  • Tip: Speeding up iWeb

    Well, I've mostly switched to using Freeway Pro for web design, but I wanted to put this tip out in the iWeb community.
    I've been playing with speeding up my websites per the suggestions from the Google Page Speed Test. What I found was that iWeb are slow! www.3michigan.org had scored 7/100 (really, really bad).
    1. Optimize the images using ImageOptim (free!) before uploading them to your web space. This means that you first have to publish to a local folder first, optimize the images, and then upload to your server using an FTP app, like Cyberduck.
    To find all the images in the local folder, navigate to it in finder, and type "blah" into the finder search. Then, press the + button and select "Kind is Image - All. Now, highlight the "blah" that you typed in prevously and hit the delete key. All the images in the local publish folder will now appear.
    Type Command-A and drag them all to the ImageOptim window. Now, ImageOptim will optimize all the images and automatically save them back into the folder where they came from.
    Now all you have to do is upload it to your webserver!
    2. Leverage Browser Caching
    Open your text editor and paste this bit of code into it:
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ## EXPIRES CACHING ##
    Save this file as "htaccess" on your computer. Then upload it to the public_html or www folder on your server. Now, rename it to ".htaccess" (Without the quotation marks). If you server hides system files, then the file should dissapear from view.
    Anyone else have any tips for speeding up an iWeb website?

    I don't really pay attention to stats because they can be manipulated so many ways and there are so many variables. The proof of the pudding is in the eating.
    If a web page takes more than a few seconds to load you will lose cutomers. I had one person claim their site loaded in so many milliseconds! Of course, it didn't. There are so many variables beyond the actual size of the files -  such as the speed of the internet connection for a start.
    So many people creating websites seem to blissfully unaware of the fact that a large and growing number of their potential customers are using wireless networks and are up against data limits. They need to learn to cut all the non essential crap no matter what way you create web pages.
    Optimizers will obviously give the best improvements on badly coded sites.
    Apps like iWeb have to have lots of divs with positioning info to allow the user to be able to drag stuff around and drop it anywhere they want. Using a little thought and minimal css you can produce an equivalent page with a fraction of the code by using the position of items in the HTML.
    When coding a site I try to avoid any positioning info apart from some floats and media queries for responsive designs. iWeb has to add this info for every item. A lot of it is inline which is one cause of slow downloading sites. The browser has to load this info for every page instead of just reading a master stylesheet once.
    Apps like Freeway and Flux do a little better but its down to the user. The more you depend on drag and drop rather than code, the more code the app has to write to make up for the users inadequacies.
    I can code a website with Flux that is faster than most but, because I can, I don't need an app like Flux or Freeway anyway.
    Its unfortunate that there's nothing much around that will help users who are unwilling to learn code to create faster loading sites since this is becoming more important due to the rapid increase of mobile devices and less people using computers to surf.
    Unfortunately, you can't build a one size fits all website without getting your hands dirty with some code. You only have to look at the amount of code that the online mobile website builders produce to see that this is just a bad joke.
    HTML5 allows us to use leaner, meaner code and the advances in CSS are helping to make up for the extinction of flash and to cut down on javascript. Browsers are begining to catch up - even Internet Explorer. Its just the people who are being left behind!
    People expect movies and slideshows on websites nowadays because they don't like to read. Movies need to be loaded in different file sizes and formats for different devices with flash fallback for older browsers. I haven't seen any software that will do that without learning code.

  • Any maintenance work needed to decrease file size / speed up initialization

    As we find that the initialization performance of the dashboard is not good, my teammate tried to cut down some data and formula in the Xcelsius file
    She keep track on the file size and found that the file size is not decreased even she removed a lot of contents. I'm thinking if there is any tools or function for to re-index or recompile the XLF file?
    Besides, any good tips to speed up initiation performance is highly appreciable!
    Note: we are working very hard in reducing the using of sumif, countif, vlookup and hlookup already but these cannot be totally avoided based on our requirements~

    Hallo Allan,
    As you already mentioned, the loading performance of the swf-file mainly depends on the amount of data included into the spreadsheet and the number and complexity of the excel-formulas you used.
    Also the number of the components placed on the the dashboard has an influence on the performance.
    To speed up the initialization the first approach would be to reduce the embedded data  and formulas.
    This can be achieved through dynamically loading the data at runtime via a data connection.
    Another approach is to split the dashboard into several XLF-/SWF-Files which are also dynamically loaded on demand at runtime.
    This can be achieved via the slide-show or swf-loader component in Xcelsius.
    The last, but not recommended, approach is to embedded the swf into a html-file and to do some calculations and navigation-logic in java-script via the external interface connection (EIC).
    Regards,
    Roman

  • How to speed up ID3 on MacBook Pro 10.6

    I recently upgraded from a G4 867 MP to a 2.26 GHz Intel Core 2 Duo, 4GB RAM running 10.6.3.
    I find ID CS3 (and Illustrator CS3, for that matter) to be sluggish, especially when bringing the programs out from hiding (for lack of a better phrase). Any tips to speed things up would be great. Maybe there's some features I can turn off or other preference settings that I can adjust.
    thanks in advance,
    John

    my software is osx mountain ranger ive managed to scan &  email my own cv to myself via public libary so i have it on my laptop still no found how to use the software on my lap top as it baffles will have get my freinds to show me i suppose ! so thanks anyway

  • Speeding up the iPhone

    Hello,
    Can anyone give me tips for speeding up my iDevice?

    bhazel wrote:
    double tap your home button and then hold down a applicaiton in tell it shakes then hit the minus sign on all of those apps. those are alll apps running on your phone at that time
    No, those apps are not all running. They are recently used apps. Very few apps actually run in the background. Closing these non-running apps will do nothing to speed up the phone.
    http://support.apple.com/kb/HT4211

  • Speeding up ID3

    Any tips for speeding up ID3? It's been gradually slowing down over time on my PC over the last couple of years. Now there is about a 5 second delay between the time you do something and it actually happening. Makes it a real pain to use.
    Same files run just fine on a similar laptop with half the memory, so it's either the PC or this installation of CS3. Photshop and Quark work just fine.
    Things that haven't helped:
    Go thru preferences and turn off anything that looks like it might slow things down.
    Max out memory
    Go to bigger hard drives.
    Run CCleaner to tidy things up
    Time to reinstall Windows and ID3?
    P4, 2.4GHz, 3.5 GB memory, Dual LCDs, Win XP Pro

    It is very unlikely that anything in InDesign 5 itself is the source of the problem. More likely, it is the system environment. Areas to look at:
    (1)     Heavily fragmented disk in conjunction with a disk with usage reaching capacity. Solution would be to defragment the disk. Obviously, if you are really short of space, it will fragment again quickly in which case a larger disk would help.
    (2)     Orphan temp files. Exit all programs and examine your temp directory or directories. You may find hundreds or even thousands of files that were not properly deleted when the programs that used them terminated, especially if such programs crashed. Delete such files and then if necessary, defragment your disk again.
    (3)     Too many startup programs and background services. It seems that every time one installs software, including what would seemingly be simple such as printer drivers, very often aditional startup programs and background services are installed. Such software consumes virtual memory, real memory, and often, significant compute cycles even when it should be dormant in the "background." Check on what such programs are actually installed and necessary for your system. Uninstall any unnecessary software. (Reformatting a disk and reinstalling Windows is often seen as a performance improvement strategy although what such system reinstallation really accomplishes is totally resetting all the bloatware that a user may have intentionally or unintentionally installed over the years.
              - Dov

  • Speeding up record store enumerations

    Ok, so the app im working on lists media (dvds, cds etc) in a tabbed list with one type per tab.
    To populate the list I'm making a seperate thread that makes a recordStoreEnumeration which filters on the current category (a byte value) and then sorts on title.
    This seems to work well, but it still takes an age to do the initial creation of the enumeration, which is, I assume, when it filters and sorts the records.
    Are there any tips for speeding this stuff up? I've already changed the Matches routine to not need to decode the full record (by putting the category byte first).
    Thanks,
    CR

    Well after taking this about as far as i can I've bought my application speed back into reasonable times to populate each form (few seconds). for several hundered items.
    The big saver was the implementation of my RecordComparator interface. Having
    private class ItemReader extends Thread implements RecordComparator,RecordFilter, Runnable {
         private Item item1 = new Item();
         private byte[] dataArray1=new byte[0];
         private ByteArrayInputStream bin1=null;
         private DataInputStream din1=null;
    public int compare(byte[] rec1, byte[] rec2) {
         if (dataArray1.length < rec1.length) {
              dataArray1 = new byte[rec1.length+100];
              bin1 = new ByteArrayInputStream( dataArray1 );
              din1 = new DataInputStream( bin1 );
         System.arraycopy(rec1,0, dataArray1, 0, rec1.length);
         try {
              bin1.reset();
              din1.reset();
    item1.resurrect(din1);
    } catch (java.io.IOException err) {
         etc.
    this technique prevents the creation (and subsequent GC) of 6 obejcts per comparison.
    A similar technique can be used with the RecordFilter interface

  • Speeding up datagroup display

    Hi all,
    I have a complex dataGroup with about 20 items that takes a long time to put on the screen ( up to 10 seconds ). I've tried virtualization, which speeds up the initial display, but in turn really slows down the scrolling. ( with virtualization, scrolling down the first time is a real pain, after having scrolled up and down once, all goes smooth)
    Now, what are some ways to speed up the datagrid? Or at least make for a smoother user expierence? I was thinking about adding a timer and only adding 1 item to the dataprovider every 100 ms or so. But before I do something hackish like that, I would love to hear some ideas on speeding up my little datagrid issue.
    Also, would using a List instead of a DataGroup speed things up?
    Any advise would be much appreciated.

    Ryan Frishberg gave a good presentation at MAX this year about performance in Flex:
    http://2010.max.adobe.com/online/2010/MAX232_1288135166359SECT
    Take a look at around the 30 minute mark for some tips on speeding up your item renderers.

  • Run Profile Deletion and Speeding up portal access

    Hi,
     My FIM 2010 R2 architecture uses 4 servers as follows:
    1 x fim server, 1 x fim sql DB (fim service DB), 1 x sync server + fim SQL DB and 1 x SSPR
    I have a PowerShell sync scripts running every 5 minutes which take fim portal changes and export those changes to AD.
    I've created some PowerShell scripts for removing old run profiles, but am not sure how many run profiles to keep? Reading online I came across one blog post which mentions that Ms recommend no more than 10,000 run profile history entries - about 4 days
    worth (although I can't find official Ms recommendations).
     I'm assuming it's OK, but are there any issues with one script running a run profile at the same time as another script which deletes older run profiles?
     On a side note, if anyone has any tips for speeding up fim portal access I'd be glad to hear them - each page in my environment takes about 30 seconds to load, regardless of the number of users connected.
    thanks in advance
    IT Support/Everything

    On a side note, if anyone has any tips for speeding up fim portal access I'd be glad to hear them - each page in my environment takes about 30 seconds to load, regardless of the number of users connected.
    If every page load of the FIM Portal is taking 30 seconds, something is broken in your environment. I get better performance than that running an entire test FIM configuration in virtualized machines on my laptop (AD, Exchange, FIM Portal/Service/Sync, etc.)
    When you first start up the environment and bring up a given page the first time, it can take some time, but once you get to steady state, you should not be seeing delays like that.
    Any chance you have an authentication configuration error (Kerberos settings, SPN assignment, DNS settings, etc.) that is causing authentication to time out on each page load?
    During that 30 second delay, are any of your servers pegged on CPU or IO?
    If this is a virtual environment or if you are using SAN based disk, do you have enough IOPS allocated?

Maybe you are looking for

  • Add Folder - is there a limit to the number of files you can add in one go?

    I have a fairly large collection (60GB+) of 192kbps mp3 files which are stored under My Music in a folder structure of Artists / Album, e.g. "My Music \ ACDC \ Back in Black\ Hells Bells.mp3" I recently bought an ipod and having installed itunes I wa

  • Website turns on volume

    Hello folks, Odd new problem: I generally work with my computer sound completely muted. However, when I navigate to the Doonesbury link (Daily Dose) from Slate, the site seems to automatically turn my computer volume on - to max volume, no less! (It

  • End of developing

    Hi, I develop a software in "Oracle database 11g express edition", now I want to change the environment to be the end user environment (for the database and the application together). 1. Please help me and tell me what I need to do 2. after this chan

  • Error Sim, Invalid Sim ios 5.1.1

    I have an iphone 4 with vodafone and from the 5.1.1 update I get errors sporadically sim, sim invalid. Is solved when I put the mobile in airplane mode, but after a few hours I happens again the same error. I tried to restore the phone but the error

  • Automate exports and imports (file names)

    Hi all, I will like to do a simple export and import into another schema in another database. I am very comfortable with the process but all i require is how to set the dump file and log file names to be the date and name of the database being export