Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I allocate contiguous disk space?

I am developing a system which works with lots of files and doing some google searches I read about improving the speed of information retrieval by the hard disk. But since I work with Java, I can't find any library to work with this issue. I have a very vague knowledge in C++, and found something about hard disk information retrieval with IOCTL. Apparently there is no way of getting specific information like how many contiguous free blocks can I get from my hard disk or the maximum of contiguous free blocks it have. I am currently working with Windows 7 and XP. I am aware of the use of JNI but I have strong problems with C++. But even searching for C++ solutions I can't find anything. Maybe I am doing some wrong queries on Google. Could someone please give me a link, suggestions of study or anything? I am willing to study C++ (although I have almost no free time).

Thank you very much!

PS-Edit: I know it would practically make no difference. But I really need to learn about this. But thanks to everyone giving advices.

like image 229
mrcaramori Avatar asked Dec 22 '22 17:12

mrcaramori


1 Answers

Have you identified a performance problem? If not, then don't do anything.

Are you sure that the physical distribution of the files on the disk is the cause of this performance problem? If not, then measure where the time is spent in your application, and try to improve the algorithms, introduce caches if necessary.

If you have done all this, and are sure it's the physical distribution of the files on the disk that's causing the performance problem, have you thought about buying a faster disk, or about using several ones? Hardware is often much cheaper than development time.

I very much doubt the physical distribution of the files on the disk has a significant impact on the performance of your app. I would search elsewhere first.

like image 140
JB Nizet Avatar answered Jan 04 '23 09:01

JB Nizet