I test this code.to see raw speed.
x = _open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);
if (x>=0) {
bench.disk_write_raw_bps = 0;
gui_bench_draw();
t = get_tick_count();
s=write(x, hook_raw_image_addr(), hook_raw_size());
t = get_tick_count() - t;
close(x);
bench.disk_write_raw_bps = s*100 / (t/10);
bench_to_draw = 2;
}
speed is same.maximum is 21918, this do also after several calls not increase on all open i test
I get too in mind, to try _Open.
But here too same speed.
only last thing i try in the benchmark code, is
swap 2 megabyte
write 2 megabyte
swap 2 megabyte
write 2 megabyte.
etc
if this enhance the speed of the benchmark, because the write to SD card need no CPU power.
If that not help, then maybe no speedup is possible.
that read is slower, is maybe because the read benchmark use 64 kb blocks.
with 64 kb blocks, write is 9256 kb only.
Camera can read 131 megabytes in ram and write 98 megabytes.
this are around 55 megabyte read and write i think.
RAW have 15 megabyte, so swap byte need 0.3 sec.thats also near praxis in savetime.
too bad, that DNG does not support little endian too, as most popular CPU are little endian.
I test this code with embedded byteswap and i use 1 megabyte buffer
x = open("A/BENCH.TMP", O_WRONLY|O_CREAT, 0777);
if (x>=0) {
int bufsize = 1*1024*1024;
s=0;
bench.disk_write_raw_bps = 0;
gui_bench_draw();
t = get_tick_count();
for (i=0;i< 16;i++)
{
reverse_bytes_order2(hook_raw_image_addr()+s,hook_raw_image_addr()+s, bufsize);
s=s + write(x, hook_raw_image_addr()+s, bufsize);
}
t = get_tick_count() - t;
close(x);
bench.disk_write_raw_bps = s*100 / (t/10);
bench_to_draw = 2;
}
write speed i get maximum is 16290 kb /s
now when use 2 megabyte buffers and reduce loop count to 8 write speed is 16865 kb /sec
with 4 megabyte buffers and loop count 4 its 17055 kb /sec
with 1 block save and swap its too 17055
so seem not possible to spead up.
I do more test on RAW.when i remove badpixel patch and thumbnail create, then save time reduce from 1.100 sec to 1.050 sec.so is no important slowdown
when i remove the byteswap for test save time is then 0.900 sec.
All in all my result is i cant speedup anything and must live with the speed ;-)
but ok, after some more test, i think 1.100 sec is ok in real world to use RAW too