Started by WillysMD, August 26, 2014, 09:52:43 PM
0 Members and 1 Guest are viewing this topic.
QuoteIt's said that "Simutrans is preferably compiled as 32 bit binary!" so I was wondering if it's wise to compile a server as a 64 bit binary?I'm trying compile Simutrans for client and server and both will be running on 64 bits machines.
QuoteSo here's my point: I was wondering how I could contribute and especially have a better understanding of the source code and it's mechanics (actually it's quite hard to understand a good million of lines you didn't write).
Quote from: DrSuperGood on August 26, 2014, 10:57:50 PMAs such 64 bit compiled clients or clients running on platforms other than x86 (32 bit) will perform considerably worse.
Quote from: DrSuperGood on August 26, 2014, 10:57:50 PMWriting code is only a small part of being a programmer. Software engineering is a lot more complex and as a computer scientist you would spend most courses learning about this rather than actual programming. I would go as far to say that computer science is about 1/4 programming and 3/4 software engineering. Sadly it is quite obvious that some of the Simutrans developers (or contributers) lacked software engineering skills.As an example, both inputs and outputs of a factory share the same underlying data class (same methods and variables) yet perform functionally differently. Adding something like a demand buffer to inputs by modifying the class used for factory inputs adds a demand buffer to outputs which is never used. Due to the behavioural differences both inputs and outputs should have been given separate classes, even if those classes mostly extend a base class. Most of the manipulation of inputs and outputs is not even done in their class forcing most members to be public and instead is done in the factory class. In this situation they might as well have been declared as "plain old data" rather than a class since they are not taking advantage of any form of object orientated programming.
QuoteI don't think a 32-bit client on x86-64 will perform much worse than on a true 32-bit x86. In any case, the latter is probably not possible to buy anymore outside specialist markets. Maybe you didn't intend to suggest otherwise, but I just write this to clear up any potential misunderstandings.
QuoteIn my education, programming sorted under software engineering, while computer science included the hardware side as well.
QuoteHave in mind that having a 64 bit executable it's going to be always slower than a 32 bit one for a simple reason, memory pointers are 64 bits and not 32, so just to start, you'll have to move twice the data from memory to CPU. Since most of the code uses just 32-bit values, it's not really worth switching to 64 bits, there is no other advantage in doing so.
QuoteIt's been some time I don't look at current chips specifications, and it might be that even loading a 32-bit value from memory just fetches 64 bit instead anyway and cache the not used part in the CPU cache, but anyway even in this case a array of pointers (there are many in simutrans), will have double the size in 64-bit than in 32-bit, making the cache perform worse.
Quote from: DrSuperGood on September 01, 2014, 05:36:35 PMNo memory pointers are not 64 bits.
Quote from: DrSuperGood on September 01, 2014, 05:36:35 PMIn theory the graphics could also be 64 bit optimized, potentially performing 2 pixel operations with a single instruction (half the amount of code run) however this depends on how rendering is implemented and still needs some mega smart assembly guru to write properly.
QuoteTry sizeof(void *) and see for yourself. My 64-bit systems always returns 8 (bytes, so 64 bits). That the address bus is only 48 bits wide is a different matter.
Quote from: DrSuperGood on September 01, 2014, 11:17:25 PMIt is also things like the translation look aside buffer, page management system, etc that all do not use 64 bit addresses.
Quote from: DrSuperGood on September 01, 2014, 11:17:25 PMSimple things like the code to pull revision version before build does not work out the box and I had to manually write the header file to get the thing to build which clearly is not intended. I do not know if it is trying to pull from an old repository or if its just because I do not have a SVN tool installed (I pulled from git) however there really ought to be a fail safe comprehensive build step guide.