Image.Load seems to be very slow, how can I increase it's performance? #1474
-
I need to load some images, about 70, from database and then choose a random item from the list and combine it with another image which I have already generated:
Well, actually with this approach, the performance is not acceptable and generating the final image takes about 15-20 seconds, I thought it will be a bad idea to load all of the 70 images from database and url path and then select a random from them, so I changed my code like this:
Well, this time I didn't load up all images and I am just loading one image from the random path, but since it is inside a while loop, the total performance is not good still, I would say, it is even worse than the old one. I was really confused, is there any way I can improve my overall performance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@SalahAkbari you are doing approximately Loading 70 images will be relatively slow with any framework/library. What is the format of your images? How large they are typically? |
Beta Was this translation helpful? Give feedback.
@SalahAkbari you are doing approximately
(11000/390) * (11000 / 1300) == 28 * 8 == 224
decodes in your second code instead of 70, so not surprising it's slower.Loading 70 images will be relatively slow with any framework/library. What is the format of your images? How large they are typically?