Riven your benchmark is nice and all… but writing files sequentially at that size and amount on the same thread will also quickly slow down the harddrive at the SAME RATE… I don’t get what point your trying to make…
It doesn’t change the fact that single threaded is still slower than multi threaded lol…
You’re also forgetting that 1) max file size is 2MB, and 2) minecraft will not be saving these files that often (you would have to be writing thousands at the same time or sequentially to get that kind of slowdown)
And I said object creation was only an example of one of the factors that can be done concurrently (parallel) on different threads. (creating a FileOutputStream object is actually really slow, almost an entire millisecond, although most of that is probably the actual opening of the file, there are still bulky operations like checking permissions)
What you’re lacking is a benchmark relative to the argument we’re having; that is, one comparing multithreaded vs singlethreaded writing (which would clearly prove I’m right, I’ve posted one, you should post your own too, just to make sure that my results aren’t biased or anything)
(either ncq or queue depth are the slowing factor, java blocks until the OS can queue IO requests. I’m going to take a wild guess and say nsigma doesn’t have ncq (enabled))
EDIT: consider this
public static void main(String[] args) throws IOException {
long start;
int i = 0;
long avg = 0;
FileOutputStream out = new FileOutputStream(new File("large"));
while (true) {
start = System.nanoTime();
out.write(new byte[1024 * 1024]);
out.flush();
long now = System.nanoTime();
avg += (now - start) / 1000000;
System.out.println("Average delay = " + (avg / ++i));
}
}
make sure you delete the large file (in your root project directory) afterwards, you should stop the program after you see the delay go up, if you wanna see throughput it’s only a small modification to the above