The invention relates generally to the field of improving performance of software products, and, more specifically, to systems and methods for efficiently loading files required by a software product.
Some software products such as anti-virus scanners, picture/video viewers, etc., process a large number of files. For example, a typical anti-virus scanner may scan all files in one or more selected folders on a hard drive of a computer or even all of the files on the hard drive. These hundreds or even thousands of files are usually loaded in the computer memory (e.g., RAM) prior to being processed.
In a typical scenario, a module of the software product requests the operating system of the computer to provide a list of files to be loaded and processed that are within a specified scope (e.g., a folder, a list of folders, a disk, etc.). The operating system returns a list of file identifiers based on the order the files are listed in a file-system database maintained by the operating system. Then, the software module, with assistance from the operating system, loads the files associated with the file identifiers in the list from permanent storage (e.g., a hard drive). The software processes a file as it is loaded, or may processes a set of files after the files in the set are loaded.
The overall performance of the software product generally depends not only on the speed of processing the loaded files, but also on the speed of loading the files. In particular, when a large number of files are to be loaded, such as by an anti-virus software, slowly loading several files can significantly affect the overall software performance. Various known techniques, however, only improve the speed of processing of the files—not the speed with which they are loaded prior to processing. According to one method, the loading and processing of files are interleaved such that the processor may analyze a previously loaded file while waiting for one or more other files to be loaded. This can increase the processor utilization, improving the overall performance of the software. These systems, however, do not improve the speed of loading of the several files, which, as described above, also adversely affects software performance. Therefore, there is a need for methods and systems for addressing file loading times, thus improving the overall performance of software products requiring processing of a large number of files.
In various embodiments of the present invention, the overall performance of a software product is improved by improving the speed of loading several files to be processed. This is achieved, in part, by obtaining additional information about the files from a list of file identifiers provided by the operating system. The additional information may include a file size, the physical position of the file on the disk, etc. Instead of accessing and loading the files in the order listed by the operating system, the files are loaded in an order based on the additional information, such as their physical position on the disk. Doing so generally causes the disk head to move in only one direction during file access. Moreover, successive movements of the disk head while accessing successive files may be shortened. This can significantly decrease the time taken to move the disk head to access each file, thereby significantly improving the speed of loading several files. This, in turn, can improve the overall software performance.
Accordingly, in one aspect, various embodiments feature a computer-implemented method for loading the files required by a software program in computer memory. The method includes obtaining a first list of file identifiers, each being associated with a respective file, and sorting the first list based on a first attribute of each of the associated files. The method also includes selecting, in sorted order, a file identifier in the sorted first list and loading the file associated with the selected file identifier. The selecting and loading steps are repeated until each file identifier in the sorted first list is selected, and the associated file is loaded.
The application program may include one or more of a virus scanner, a spyware scanner, an ad-ware scanner, a malware scanner, a backup program, a multicopy program, a compiler, and a data-mining program. In some embodiments, the file identifier includes a file entry in a directory record, and the first attribute may include location of files associated with the file identifiers. The location may be a cluster location.
In some embodiments, obtaining the first list of file identifiers includes receiving a second list of the file identifies. For each file identifier in the second list (i) a second attribute of a file associated with the file identifier is compared with a pre-determined threshold, and (ii) based on the comparison, the file identifier is selectively added to the first list. The second attribute may include file size and the threshold may be, for example, one Kbyte.
In some embodiments, the loaded files are analyzed and the analyzing step may include scanning the loaded file for at least one of virus, spyware, adware, and malware. The analyzing step may also include copying the file to another memory location, through a network or directly, compiling the file, and/or extracting information from the file.
In some embodiments, the software program is a boot program, and obtaining the first list of file identifies includes recording, during a prior execution of the boot program, each file loaded in the computer memory. Obtaining the first list further includes storing a file identifier corresponding to the loaded file in the first list of file identifiers, storing the first list on a non-volatile memory (e.g., a hard disk, flash memory, etc.), and accessing the stored first list during a subsequent execution of the boot program. The loading step may include storing the files in a cache memory, and the method may further include accessing the files from the cache memory, and analyzing the accessed files.
In another aspect, various embodiments feature another computer-implemented method for loading, in computer memory, files required by a software program. The method includes receiving a first list of file identifies, each being associated with a respective file. For each file identifier in the first list (i) a first attribute of the associated file is compared with a pre-determined threshold, and (ii) based on the comparison, that file identifier is selectively added to a second list. The method also includes sorting the second list based on a second attribute of the files associated with the file identifiers in the second list, selecting, in sorted order, a file identifier in the sorted second list, and loading the file associated with the selected file identifier. The selecting and loading steps are repeated until each file identifier in the sorted second list is selected.
In another aspect, various embodiments feature a system for enhancing performance of a software program. The system includes a sorter module for (i) obtaining a first list of file identifiers, each being associated with a respective file, and (ii) sorting the first list based on a first attribute of each of the associated files. The system also includes a loader module for selecting, in sorted order, each file identifier in the sorted first list, and loading the file associated with the selected file identifier. The application program may include one or more of a virus scanner, a spyware scanner, an ad-ware scanner, a malware scanner, a backup program, a multicopy program, a compiler, and a data-mining program.
In some embodiments, the file identifier includes a file entry in a directory record, and the first attribute may include location of files associated with the file identifiers. The location may include a cluster location. The sorter module may be configured to receive a second list of the file identifies, and for each file identifier in the second list (i) to compare a second attribute of a file associated with the file identifier with a pre-determined threshold, and (ii) based on the comparison, to add selectively the file identifier to the first list. The second attribute may include file size and the threshold may be, e.g., one Kbyte.
In some embodiments, the system further comprises an analyzer for analyzing the loaded file. The analyzer may be configured to scan the loaded file for at least one of virus, spyware, adware, and malware. The analyzer may also be configured to copy the file to another memory location, through a network or directly, compile the file, and/or to extract information from the file.
In some embodiments, the software program is a boot program, and the sorter module is configured to record, during a prior execution of the boot program, each file loaded in the computer memory. The sorter module is also configured to store a file identifier corresponding to the loaded file in the first list of file identifiers, to store the first list on a non-volatile memory (e.g., hard-disk, flash memory, etc.), and to access the stored first list during a subsequent boot operation. In some embodiments, the system comprises an analyzer module, and the loader module is configured to store the files in a cache memory. The analyzer module is configured to access the files from the cache memory, and to analyze the accessed files.
In another aspect, various embodiments feature another system for enhancing performance of a software program. The system includes a sorter module to receive a first list of file identifies, each being associated with a respective file. For each file identifier in the first list, the sorter module: (a) compares a first attribute of the associated file with a pre-determined threshold, and (b) based on the comparison, selectively adds that file identifier to a second list. Moreover, the sorter module sorts the second list based on a second attribute of the files associated with the file identifiers in the second list. The system includes a loader module for selecting, in sorted order, each file identifier in the sorted second list, and for loading the file associated with the selected file identifier.
Other aspects and advantages of the invention will become apparent from the following drawings, detailed description, and claims, all of which illustrate the principles of the invention, by way of example only.
In the drawings, like reference characters generally refer to the same parts throughout the different views. Also, the drawings are not necessarily to scale, emphasis instead generally being placed upon illustrating the principles of the invention.
A computer hard drive typically includes mechanical parts such as several rotating magnetic disks and one or more read/write heads that access the disks. Data representing the various files used by the computer are stored in cylindrical tracks on one of the magnetic disks. Before the file data can be accessed, i.e., read and/or written, the disk head is moved to a location over the track where that file (or portion of the file) is located. The disk-head movement takes some time, typically on the order of 3-12 ms on an average per file access, depending on the size and quality of the disk drive. In fact, the seek time, i.e., the time required to position the disk head at a required location, is often a significant bottleneck of accessing and loading files.
In general, there is no correlation between the physical position of a file on the hard disk and the position of its record (i.e., the entry of the file identifier) in the file system database. As a result, in a conventional system in which numerous files are accessed in the order of their record in the file-system database, the disk head typically moves back and forth in a far from optimal manner. For example,
With reference to
With reference to
For each file identifier in the list, in step 304 the size of the associated file is compared with a certain threshold (e.g., 1 Kbyte). A file smaller in size than the threshold may not be stored on the hard drive, and instead, may be stored in the directory record (e.g. a Master File Table (MFT) record) in the file-system database maintained by the operating system. Therefore, such a file is processed immediately in step 306, because the time to seek that file is not related to disk-head movement. In other alternative implementations, the files that are below this size threshold may be retrieved subsequent to retrieving the larger files from the disk.
Any file that is larger than the threshold is stored somewhere on the hard drive. In step 308, the file identifier associated such a file is stored in a second list. Various other file parameters, such as the volume handle, the unique file id, and the file start position (cluster) are also stored and associated with the file identifier in the second list. The steps 302, 304, and the step 306 or 308 are repeated until all of the file identifiers in the first list have been analyzed.
In step 310, the second list of file identifiers is sorted based on the starting cluster of the associated files. The starting cluster represents the physical position of a file on the hard drive. In step 312, a file identifier is selected from the sorted second list in order, i.e., in the order of the physical position of the associated file, and is loaded in computer memory using standard functions provided by the operating system. The full path of the file to determine its location may be obtained using information stored in the second list.
The loaded file is analyzed in step 314. The specific analysis performed depends on the overall functionality of the software product. For example, a virus/malware scanner may scan the loaded file for virus, adware, malware, spyware etc. Similarly, a photo-viewer may display an image in the file in a photo album. A file transfer, backup, and/or multicopy program may copy the file to a new location on the disk drive or to another computer over a network. Compilers and data-mining software products may also access a large number of files. The steps 312, 314 are repeated for all of the file identifiers in the sorted second list. In some embodiments, all or a subset of files are loaded in the memory and then the loaded files are analyzed. As described above with reference to
In an exemplary process 400 described with reference to
During a subsequent execution of the software, the list of required files may be found in step 402. In step 406, that list is sorted in the order of the physical positions of the files. The information about the physical position of a file may be obtained from the operating system using a unique file identifier associated with the file. Then in step 408, the files in the sorted list are loaded in order and may be stored in cache memory. The execution of the software (e.g., the boot component of the operating system) is suspended during the steps 406 and 408 while the required files are loaded. When execution of the software continues, the required files are accessed from the cache memory. Once again, the process 400 enhances software performance by decreasing or minimizing the total time required to load all of the files needed by the software, because the files are loaded in the order of their physical position on the hard drive, thereby avoiding unnecessary disk-head movements.
Referring to
The sorter module 522 receives a list of file identifiers associated with the files to be processes by the application 520 from the file-system database 514. Alternatively, the sorter module 522 can record the files processed by the software 520 and store a list of those files. Generally, the files are located on the hard drive 506, but some small files may be located in a table maintained by the file-system database 514.
The sorter module 522 optionally stores and sorts a list of file identifiers selected from the first list received or generated by the sorter module 522. Then, using the os-file-loader 516 the loader module 524 loads the files in the sorted order, as described with reference to
Each functional component described above (e.g., the sorter module, the loader module, and the file-analyzer module) may be implemented as stand-alone software components or as a single functional module. In some embodiments the components may set aside portions of a computer's random access memory to provide control logic that affects the interception, scanning and presentation steps described above. In such an embodiment, the program or programs may be written in any one of a number of high-level languages, such as FORTRAN, PASCAL, C, C++, C#, Java, Tcl, PERL, or BASIC. Further, the program can be written in a script, macro, or functionality embedded in commercially available software, such as EXCEL or VISUAL BASIC.
Additionally, the software may be implemented in an assembly language directed to a microprocessor resident on a computer. For example, the software can be implemented in Intel 80×86 assembly language if it is configured to run on an IBM PC or PC clone. The software may be embedded on an article of manufacture including, but not limited to, computer-readable program means such as a floppy disk, a hard disk, an optical disk, a magnetic tape, a PROM, an EPROM, or CD-ROM.
The invention can be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The foregoing embodiments are therefore to be considered in all respects illustrative rather than limiting on the invention described herein.
Number | Name | Date | Kind |
---|---|---|---|
5345575 | English et al. | Sep 1994 | A |
6073232 | Kroeker et al. | Jun 2000 | A |
6081799 | Beavin et al. | Jun 2000 | A |
6206289 | Sharpe et al. | Mar 2001 | B1 |
6226422 | Oliver | May 2001 | B1 |
6256728 | Witt et al. | Jul 2001 | B1 |
6442682 | Pothapragada et al. | Aug 2002 | B1 |
6574713 | Kosche et al. | Jun 2003 | B1 |
6601167 | Gibson et al. | Jul 2003 | B1 |
6606617 | Bonner et al. | Aug 2003 | B1 |
6633968 | Zwiegincew et al. | Oct 2003 | B2 |
6671774 | Lam et al. | Dec 2003 | B1 |
6748534 | Gryaznov et al. | Jun 2004 | B1 |
6751780 | Neff et al. | Jun 2004 | B1 |
6981099 | Paulraj et al. | Dec 2005 | B2 |
7000077 | Grimsrud et al. | Feb 2006 | B2 |
7065790 | Gryaznov | Jun 2006 | B1 |
7139909 | Lee | Nov 2006 | B2 |
7359890 | Ku et al. | Apr 2008 | B1 |
7380725 | McGill | Jun 2008 | B2 |
7383417 | Yasue et al. | Jun 2008 | B2 |
7434261 | Costea et al. | Oct 2008 | B2 |
7437504 | Waldvogel | Oct 2008 | B2 |
7506374 | Carmona | Mar 2009 | B2 |
7568233 | Szor et al. | Jul 2009 | B1 |
7581253 | Challener et al. | Aug 2009 | B2 |
7647297 | LaChapelle et al. | Jan 2010 | B2 |
7669044 | Fitzgerald et al. | Feb 2010 | B2 |
7743060 | Fontoura et al. | Jun 2010 | B2 |
7760654 | Adya et al. | Jul 2010 | B2 |
7778983 | Jorden et al. | Aug 2010 | B2 |
7788650 | Johnson et al. | Aug 2010 | B2 |
7836504 | Ray et al. | Nov 2010 | B2 |
7845008 | Waltermann et al. | Nov 2010 | B2 |
7861296 | Costea et al. | Dec 2010 | B2 |
7937263 | Carrier et al. | May 2011 | B2 |
7949665 | Millard et al. | May 2011 | B1 |
7975025 | Szabo et al. | Jul 2011 | B1 |
7984503 | Edwards | Jul 2011 | B2 |
1020922 | Tikkanen et al. | Aug 2011 | A1 |
1021920 | Asaad et al. | Sep 2011 | A1 |
1022512 | Jarrett et al. | Sep 2011 | A1 |
8087081 | Chun et al. | Dec 2011 | B1 |
8087084 | Andruss et al. | Dec 2011 | B1 |
8091134 | Benton et al. | Jan 2012 | B2 |
20020067515 | Abe | Jun 2002 | A1 |
20030115479 | Edwards et al. | Jun 2003 | A1 |
20030120952 | Tarbotton et al. | Jun 2003 | A1 |
20040158730 | Sarkar | Aug 2004 | A1 |
20040230748 | Ohba | Nov 2004 | A1 |
20050195435 | Kojima et al. | Sep 2005 | A1 |
20050216759 | Rothman et al. | Sep 2005 | A1 |
20050219657 | Sasaki et al. | Oct 2005 | A1 |
20060101264 | Costea et al. | May 2006 | A1 |
20060161546 | Callaghan et al. | Jul 2006 | A1 |
20060294356 | Kumar et al. | Dec 2006 | A1 |
20070055711 | Polyakov et al. | Mar 2007 | A1 |
20070078915 | Gassoway | Apr 2007 | A1 |
20070156677 | Szabo | Jul 2007 | A1 |
20070294767 | Piccard et al. | Dec 2007 | A1 |
20080005797 | Field et al. | Jan 2008 | A1 |
20080086290 | Wilson | Apr 2008 | A1 |
20080155339 | Lowe et al. | Jun 2008 | A1 |
20080195676 | Lyon et al. | Aug 2008 | A1 |
20080209198 | Majni et al. | Aug 2008 | A1 |
20080229016 | Waites | Sep 2008 | A1 |
20090049550 | Shevchenko | Feb 2009 | A1 |
20090198738 | Berger et al. | Aug 2009 | A1 |
20090199190 | Chen et al. | Aug 2009 | A1 |
20090222923 | Dixon | Sep 2009 | A1 |
20090235134 | Guo et al. | Sep 2009 | A1 |
20090249055 | Itoh | Oct 2009 | A1 |
20090287842 | Plamondon | Nov 2009 | A1 |
20100011029 | Niemela | Jan 2010 | A1 |
20100017591 | Smith et al. | Jan 2010 | A1 |
20100023679 | Blum | Jan 2010 | A1 |
20100031361 | Shukla | Feb 2010 | A1 |
20100083381 | Khosravi et al. | Apr 2010 | A1 |
20100149593 | Dowling et al. | Jun 2010 | A1 |
20100162400 | Feeney et al. | Jun 2010 | A1 |
20100169972 | Kuo et al. | Jul 2010 | A1 |
20100241654 | Wu et al. | Sep 2010 | A1 |
20100269032 | King et al. | Oct 2010 | A1 |
20110271347 | Zimmer et al. | Nov 2011 | A1 |
20110296525 | Turbin | Dec 2011 | A1 |
Number | Date | Country |
---|---|---|
2002346639 | Jun 2003 | AU |
2680601 | Dec 2009 | CA |
0201848 | Nov 1986 | EP |
1229433 | Aug 2002 | EP |
1835409 | Sep 2007 | EP |
2194471 | Jun 2010 | EP |
2251781 | Nov 2010 | EP |
2007317190 | Dec 2007 | JP |
2008191824 | Aug 2008 | JP |
2008305225 | Dec 2008 | JP |
2009020765 | Jan 2009 | JP |
2010074604 | Apr 2010 | JP |
2010237837 | Oct 2010 | JP |
9915953 D2 | Apr 1999 | WO |
WO-2004055667 | Jul 2004 | WO |
WO-2008112770 | Sep 2008 | WO |
WO-2009042986 | Apr 2009 | WO |
WO-2010142594 | Dec 2010 | WO |
WO-2011153239 | Dec 2011 | WO |
Entry |
---|
“On the Care and Feeding of the Spinning Disks” [online] by Alex Russell. Retrieved from the internet on Feb. 27, 2012: http://infrequently.org/2011/01/on-the-care-and-feeding-of-spinning-disks, 6 pp. |
“Prefetcher—Wikipedia, the free encyclopedia” [online]. Retrieved from the internet on Feb. 27, 2012: http://en.wikipedia.org/wiki/Prefetcher, 3 pp. |
International Search Report, Application No. PCT/IB2013/000696, date of mailing Sep. 2, 2014. |
Number | Date | Country | |
---|---|---|---|
20130227544 A1 | Aug 2013 | US |