I am surprised looking at the speed of most AV scanners. Let us say there is a 1 MB file which may potentially have one or more of 89000 viruses. All their signatures have to be searched in the entire content of the 1 MB file, as I understand it. Then, how is this done so fast, where the 1 MB file is scanned in less than a second?

Hope I could get hold of an opensource AV solution so that I could read the code to understand the excellence behind.

Any information on this topic will be helpful.