The only reliable way to make anything faster is to run a profiler to find out which bits are taking the time and then run the profiler on your changes to see if they are improving the performance.
This is what i did to try to make this faster...
Each thread in this arraylist contains threads from the first piece of code.
Throwing threads at the problem is not the solution. You may find adding a few threads increases the performance on your machine and decreases it on another machine. Threads will only help if you have idle processors but if the delays are due to I/O bottle necks or 100% CPU usage more threads will just slow things down.
It could be that loading the size and format of your images just takes time.
You could try changing the image format to see if a different format loads any faster. Reducing the image size (if that is acceptable) will also speed up loading, or use a JPEG format with a high compression value which will reduce the file size without reducing the image size (the image quality will of course be reduced).
I already reduce image size, I save a thumbnail in jpeg format that is on average about 3kb.
I tried higher compression but time is not reduced.. so i guess, there really isn't much to be done.
The first time the user adds images i create the thumbnails, which takes even longer, but once they are created my application only loads the thumbnails, which is what i wanted to fix..
So is your application displaying the GUI immediately with place holders which are replaced as the thumbnails are loaded or is the problem that the GUI takes ages to display.
Do you need to have so many images in one place, can you divide them into sections so you don't have to load so many at a time.
my application adds the images to a JPanel with GridLayout, so, when there are many images, the time it takes for all pictures to be loaded is very long.
I was watching Windows' behaviour when loading images and it's not much faster than my app, but what it does is, it only loads images visible to the user. So I think i will try something like that.
First, add placeholders with a default image, and when the users scrolls to another place, just load whatever pictures are on the screen at the time..
So is your application displaying the GUI immediately with place holders which are replaced as the thumbnails are loaded or is the problem that the GUI takes ages to display.
Do you need to have so many images in one place, can you divide them into sections so you don't have to load so many at a time.
Bookmarks