GetFileAttributesW slow down system


I'm getting feedback from some of our users about slow down time in some file operations. I have isolated the problem to the function "File::existsAsFile" and more specifically to the windows function "GetFileAttributesW", in some cases this function takes a long time to return (many seconds). Has anyone noticed this problem before? Is there any solution?

I suppose that if you called it with a path that's on a network drive then it could go awol, but I don't think it'd make sense to blame the function itself for being slow.

From what I know it happens too with removable storage devices (pendrives, usb hd, etc...). Maybe I should just check if the file is on a removable disk before asking if it exists or not and then implement some workaround in this case... well I'm not sure yet what is the best option for me.

This problem is important in my case because the "GetFileAttributesW" is used in a song manager and despite of the fact that I use a cache system it can make the overall program look sluggish when songs are browsed in a few systems.