I've written a little utility app to store various details about files located on my network. I've been trying to optimise it as it's taking quite a bit of time to run. There are 3 main sections in the program flow.
1 - Gathering details for each of the files in the specified network location.
2 - Checking to see if there are any duplicates within those files gathered above.
3 - Displaying statistical information about the files
Roughly 95% of the time taken for the program to run is in the gathering of file details. This is to be expected, but now I'm trying to optimise the retrieval of the details across the network. For each file I need several pieces of information:
The file name, absolute file path, file size and last modified date.
I've timed the retrieval of each of these pieces of information (using System.nanoTime()) and the time taken to get the file name and absolute path is always 0ms, but getting the file size takes 3-4ms and getting the last modified date takes another 3-4ms.
Is it possible to force the program to retrieve both the file size and the last modified date in one network trip? This would roughly half the time taken to gather the file details.
Thanks in advance for any help or information.
1 - Gathering details for each of the files in the specified network location.
2 - Checking to see if there are any duplicates within those files gathered above.
3 - Displaying statistical information about the files
Roughly 95% of the time taken for the program to run is in the gathering of file details. This is to be expected, but now I'm trying to optimise the retrieval of the details across the network. For each file I need several pieces of information:
The file name, absolute file path, file size and last modified date.
I've timed the retrieval of each of these pieces of information (using System.nanoTime()) and the time taken to get the file name and absolute path is always 0ms, but getting the file size takes 3-4ms and getting the last modified date takes another 3-4ms.
Is it possible to force the program to retrieve both the file size and the last modified date in one network trip? This would roughly half the time taken to gather the file details.
Thanks in advance for any help or information.