Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reduce amount of string comparisons for handling packets
#7
With the most optimized code, you may take it from really slow to really slow - 1. You can't speed up something just by cleaning up the code around it. Simple file I/O like string reading along with variable-location I/O like the INI reading is very slow. Period. It has nothing to do with the code used to do it, its just the method itself. With INIs, you are scanning a file up and down looking for the value before you parse it and read it. With string file I/O, its not as bad since it is a linear read, but it still has to convert the structure to a string, and you have to parse the values of the string yourself. Binary is just the most efficient method for linear file reading - nothing can beat it, and I doubt anything ever will, unless the memory and/or file structure is changed. Heck, its probably even a hell of a lot faster if you're reading a file in the wrong endian even.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)