The results of a couple of tests dumping lv2 using the default system buffer for file i/o:
for 4.21 cfw:
elapsed time: 5.142354
for 4.84 hen:
elapsed time: 4.683867
compare to using our own user space buffer for file i/o:
for 4.21 cfw:
elapsed time: 0.008148
for 4.84 hen:
elapsed time: 0.008045
I guess that is in seconds using clock() and dividing by CLOCKS_PER_SEC
631 times as fast for cfw
582 times as fast for hen
with this small amount of data, maybe better just to say approximately 4 or 5 seconds faster.
These times are only for the block of code that does the actual copy and save, so doesn't include start up code, etc
These results may suggest it could be worthwhile trying setvbuf() to speed up file i/o.
the updated code:
1. added timer.
2. fixed typo which made alternate save path same as default save path.
3. instead of creating custom opd entry for copy_to_user as we would for a custom function, uses the official opd entry already present for copy_to_user which only requires one lv2 poke instead of three.
To adapt to different firmware version requires only 2 changes:
1. address of copy_to_user opd entry
2. address of syscall 20 entry in syscall table, or whatever syscall used