ImageSearch - Cacheing or storing image in RAM?

Ask gaming related questions (AHK v1.1 and older)
User avatar
Xennon
Posts: 12
Joined: 12 Oct 2014, 19:27

ImageSearch - Cacheing or storing image in RAM?

13 Oct 2014, 18:46

I'm writing a script which makes heavy use of the ImageSearch function and was wondering if it is possible to have the images I'm searching for pre-loaded into memory and held there so as to have them always ready for the ImageSearch function without needing to re-load them from the hard drive each time they are needed. I'm unsure if AHK caches these files or not, and I want the script to run as seamlessly and quickly as possible and not be hindered by the need to access the hard drive every time I use the ImageSearch function.

Can this be done? What do I need to do to facilitate this?

Any help appreciated.
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: ImageSearch - Cacheing or storing image in RAM?

23 Oct 2014, 03:26

I think it is better to use RAM drive. There are many software to make RAM disk, for example free one: https://www.softperfect.com/products/ramdisk/ .
Also I think it is better to move that thread to Ask For Help section becouse it is not only game related.
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
User avatar
Almost_there
Posts: 404
Joined: 30 Sep 2014, 10:32

Re: ImageSearch - Cacheing or storing image in RAM?

11 Apr 2015, 15:00

Hi. I know it's an old thread but OP should know that if a file is read by Windows, it's cached automatically by Windows.
Therefore I cannot see that there is any need for AHK to cache small files that is probably already in ram.
User avatar
berban
Posts: 97
Joined: 14 Apr 2014, 03:20

Re: ImageSearch - Cacheing or storing image in RAM?

11 Apr 2015, 15:05

So you want to speed up imagesearch right? I'd say you're better off doing that in AutoHotkey itself. Try making the following modifications:
- Reduce screen area that is being searched
- Reduce color variation allowed
- Reduce image size (matters less)
The time to Imagesearch is about directly proportional to these things so it is definitely more time consuming than the actual loading of the image
User avatar
Almost_there
Posts: 404
Joined: 30 Sep 2014, 10:32

Re: ImageSearch - Cacheing or storing image in RAM?

20 Apr 2015, 18:15

I've used a simple approach in some cases to reduce search time. Assume that when searching by imagesearch, most time, the second time searching for the same image will probably hit the image at same location as first found.

Therefore I made simple a function that remembers (Static) the last position if found, so that next time the search area is exactly the same as where the images ast location. Try that idea.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: mikeyww and 53 guests