by Picard » Sun Jul 07, 2002 2:03 pm
without optimalization turned on, all variables is loaded/saved in memory at every access. register keyword can be important for local variables which is used many times in small part of the code.
i don't know if it's the fastest or not, but for high speed program versions i use manual i/o processing (no scanf, printf or what ever). reading all input in one huge buffer and buffering all output in another big buffer. for example in my integer/double read/write routines it's crucial to use register keyword.
i use C++ not because of STL classes or virtual methods. i think it's just easier as C, you have more freedom and compiler warnings.
10282: what features did i use? only two function calls: one read() at begining and one write() at the end. i'am using lexical tree search (i'am not sure this is the right name) using the 'a'..'z' charachter range in every level. the speed "boost" from 0.230 to 0.180 was because i reduced the memory need with eliminating the last nodes in the tree (if possible), so i have pointers with two possible types: point to another node or to directly to an english string (which is the English translation of current path)