Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
Gold Member
Dearly Missed
- 35,003
- 21,712
yungman said:BUT that heavily involve R/W to hard disk or flash memory, it will be very slow. I think it's better to do all those in RAM first and copy one time to file.
Whoa! Slow down!
First, you want to get your code working first before deciding it's too slow. Getting a wrong answer faster is no real virtue.
Second, you have no idea whether your code is too slow until you run it. Your records are 88 bytes long, so a modern disk can read in two million of these records per second.
Finally, you have no idea where your code is too slow until you run it. Spending time optimizing one part can be a total waste if it's some other part slowing you down.
PS If you are planning on using a bubble sort, it is unlikely that disk read time will be your biggest concern.
Last edited: