![]() |
Reduce amount of string comparisons for handling packets - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Reduce amount of string comparisons for handling packets (/showthread.php?tid=1475) |
Re: Reduce amount of string comparisons for handling packets - Dragoons Master - 24-12-2007 AddressOf() just gives you the pointer to the memory where the functions that handles the packets are. Pointers are veeeeery fast, I mean, very very very much faster than any comparison. I'm almost sure that this system is much faster than any other, and that's why I use it xD Re: Reduce amount of string comparisons for handling packets - Dragoons Master - 24-12-2007 Nono, VB6 has a switch, its named select: Code: Select Case Statement Re: Reduce amount of string comparisons for handling packets - Rezeyu - 24-12-2007 Verr or Spodi already said (I forget who) That there's no real speed difference between Cases and Conditionals. Re: Reduce amount of string comparisons for handling packets - Anthony - 24-12-2007 While we are sort of on the subject.. Is taking the time to convert to byte arrays really worth all the work? Re: Reduce amount of string comparisons for handling packets - Rezeyu - 25-12-2007 I only noticed it when I was wondering why the Ubound of parse was 1 higher, and realized that End_char was the last one. Re: Reduce amount of string comparisons for handling packets - Spodi - 25-12-2007 If it is performance you are after, theres many other places you should be looking before dealing with this. One thing I have come to realize, though, is that companies like Mac take a much better approach - get things completed quickly with just the minimalist features and very stable. From there, you can expand on the features and worry about performance. Even if you don't release it until the very end, its a hell of a lot easier to test something if it is slow but works in comparison to fast and broken. Re: Reduce amount of string comparisons for handling packets - Spodi - 25-12-2007 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. Re: Reduce amount of string comparisons for handling packets - Kenko - 25-12-2007 Spodi Wrote: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. -1 = faster, even if it's barely anything. ![]() Re: Reduce amount of string comparisons for handling packets - Spodi - 26-12-2007 I think you missed the point that it is still really really slow. :wink: Time would be much better spent actually making the game so its performance can actually be put to use. If I wrote a renderer that puts Farcry to shame that could run at 100 FPS on a 233mhz comp, no one would care if there was no content for it to draw. Re: Reduce amount of string comparisons for handling packets - Rezeyu - 26-12-2007 The point was that you could have the most powerful, faster, optimized engine, but without a game to play it with, it's useless. Re: Reduce amount of string comparisons for handling packets - Spodi - 26-12-2007 DFA Wrote:100 FPS because a PC with a 233MHZ CPU will have a monitor and gfx card that supports 100Hz refresh rate? Don't need a 100Hz refresh rate to have 100 FPS. You'd only need it to display 100 FPS. You can draw as many frames as you want if you just discard instead of waiting for the vertical sync. Its not like drawing faster than you're refreshing is a new concept or anything. Re: Reduce amount of string comparisons for handling packets - Rezeyu - 26-12-2007 Cough ![]() Re: Reduce amount of string comparisons for handling packets - Dragoons Master - 26-12-2007 Rezeyu Wrote:Cough ![]() Re: Reduce amount of string comparisons for handling packets - Spodi - 27-12-2007 Eh? I never said there WAS no support for 100Hz+ frequencies, I just said you don't need one. Of course theres graphic cards and monitors that support it, though how useful it is is another story. Re: Reduce amount of string comparisons for handling packets - Rezeyu - 27-12-2007 I was replying to DFA. XD Re: Reduce amount of string comparisons for handling packets - Spodi - 27-12-2007 Damn, I knew I was going to be told I was misreading that. Bad Spodi, bad! Re: Reduce amount of string comparisons for handling packets - Robin - 27-12-2007 Spodi Wrote:Damn, I knew I was going to be told I was misreading that. Someone needs to go spend all their donated dollars on alcohol :D |