Results 1 to 5 of 5
Thread: Help redrawing large image
- 12-14-2009, 10:09 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
Help redrawing large image
I have a 600x600 applet that redraws each pixel (drawing the mandelbrot set).
Right now (just using a for loop and paint() method) it swipes down drawing the pixels and takes a couple seconds.
I tried to draw an image offscreen and paint that on but it still took the same amount of time since it needed to still draw each pixel to the offscreen image.
I was wondering what I need to do to make it faster. Would threads be the solution?
Thanks
- 12-14-2009, 10:16 PM #2
can you do threads with the mandelbrot set ?
i would guess if you model the image area as two images adjacent, like cut the image in half horizontally, and then have two threads to render each half concurrently, to see if that does indeed do a speedup.
typically a Java thread would map to a host system CPU or CPU core, so if a user only has one CPU, subdividing a lot to make it work on several threads won't necessarily improve performance.
Though now a days, 2-4 cores are more common than they used to. I guess you could get fancy with an option for how many worker threads to use and then go with that, dividing the image into pieces.
- 12-14-2009, 10:55 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
Thanks for the reply I'll try it out.
-
I wonder if you could use memoization to speed up your calculations (Jos's previous suggestion on this has now got it stuck in my brain!)?
- 12-14-2009, 11:49 PM #5
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,158
- Rep Power
- 5
Similar Threads
-
Large data over RMI
By JavaDesigner in forum New To JavaReplies: 7Last Post: 10-16-2009, 08:48 PM -
Reading large XML
By gkumar in forum XMLReplies: 3Last Post: 08-06-2009, 04:38 AM -
Creating Large projects
By Mr.Beans in forum New To JavaReplies: 1Last Post: 04-07-2009, 01:38 AM -
Compare 2 large files
By bezudar in forum Advanced JavaReplies: 3Last Post: 11-23-2008, 02:18 AM -
problem in redrawing JTable
By abhinav in forum AWT / SwingReplies: 0Last Post: 11-21-2007, 09:08 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks