Silentkilarz Posted Wednesday at 10:09 PM Share Posted Wednesday at 10:09 PM 34 minutes ago, Badger73 said: I'd like to play that! Where could I find this "Road to Mortain" campaign? Or did you mean to say "Road to Montebourg" instead? Its on the Original CMBO so the first game. 0 Quote Link to comment Share on other sites More sharing options...
Thomm Posted Thursday at 10:52 AM Share Posted Thursday at 10:52 AM On 10/12/2024 at 2:59 PM, Redwolf said: Python is extremely slow, though. Unless you only use it as glue to connect C code modules (like they do in many machine learning frameworks). And interfacing C# and Python will be no fun at all since you have to go through a C layer. I have just now replaced a brute force Fortran implementation of a node-to-attached-elements search by a plain Python implementation using lists and dictionaries, and achieved a speed-up by a factor of one hundred! The only problem now is how to explain to the customers why the function (not originally written by me, remark) was so slow in the first place. Furthermore, I recommend everybody into programming to check out test driven development. It improves the quality of software right from the start. You just think differently about your code when you write the tests before the code itself. Learned pretty late about it, but am loving it already! 0 Quote Link to comment Share on other sites More sharing options...
A Canadian Cat Posted Thursday at 01:54 PM Share Posted Thursday at 01:54 PM 2 hours ago, Thomm said: I have just now replaced a brute force Fortran implementation of a node-to-attached-elements search by a plain Python implementation using lists and dictionaries, and achieved a speed-up by a factor of one hundred! Totally OT but choosing the correct algorithm is where the real performance improvements are found. I am not familiar with modern Fortran implementations (last time I programmed in Fortran was 1992) but I doubt it is among the most performant language choices you can make. Now if you are already using a python library that is implemented in C/C++ to do some of the heavy lifting then you could already be close to as fast as you can get. However if you hand wrote the implementation then you may well see another significant performance improvement if you were to switch to C/C++. See this article: https://www.freecodecamp.org/news/python-vs-c-plus-plus-time-complexity-analysis/ 2 hours ago, Thomm said: Furthermore, I recommend everybody into programming to check out test driven development. It improves the quality of software right from the start. This is mostly a good thing, agreed. 2 hours ago, Thomm said: The only problem now is how to explain to the customers why the function (not originally written by me, remark) was so slow in the first place. Yeah, that can be an interesting discussion. Your tests from the test driven development approach will help with part of it. One objection will be "but is is really doing the same thing as the previous version". With a series of tests you can probably support your position that you *are* doing the same thing with the new code. As for the objection "but why didn't you do this the first time". That one is challenging. You have to some how imply that previous developers did not do their job well without saying that outright One approach could be that at first that code's performance didn't matter as much as now and that's why your company put the resources towards fixing it. 2 Quote Link to comment Share on other sites More sharing options...
Centurian52 Posted Thursday at 03:09 PM Share Posted Thursday at 03:09 PM 1 hour ago, A Canadian Cat said: However if you hand wrote the implementation then you may well see another significant performance improvement if you were to switch to C/C++. See this article: https://www.freecodecamp.org/news/python-vs-c-plus-plus-time-complexity-analysis/ Wow! I knew that C++ had a reputation for being fast. But I never wrote a program complex enough to appreciate the difference. So I had no idea how much faster it was compared to other languages (such as Python). 0 Quote Link to comment Share on other sites More sharing options...
Redwolf Posted Thursday at 03:46 PM Share Posted Thursday at 03:46 PM 35 minutes ago, Centurian52 said: Wow! I knew that C++ had a reputation for being fast. But I never wrote a program complex enough to appreciate the difference. So I had no idea how much faster it was compared to other languages (such as Python). Not only is the same code about 80 times slower on the same CPU, default Python threads also fail to make use of multiple CPUs/cores, which is a big issue on today's computers. As all CM players know. 0 Quote Link to comment Share on other sites More sharing options...
Thomm Posted Thursday at 04:42 PM Share Posted Thursday at 04:42 PM To be honest, the examples in the article look like something that you would import the NumPy module for instead of using plain Python loops. I would be more interested in a comparison of the higher level stuff like dynamic lists and dictionaries. In my application, a dictionary of dynamic lists, which takes a few seconds to set up in Python, but then provides access a hundred times faster than the original brute-force Fortran solution. 0 Quote Link to comment Share on other sites More sharing options...
Redwolf Posted Thursday at 10:04 PM Share Posted Thursday at 10:04 PM 5 hours ago, Thomm said: To be honest, the examples in the article look like something that you would import the NumPy module for instead of using plain Python loops. I would be more interested in a comparison of the higher level stuff like dynamic lists and dictionaries. In my application, a dictionary of dynamic lists, which takes a few seconds to set up in Python, but then provides access a hundred times faster than the original brute-force Fortran solution. Using the wrong data structures and algorithms will usually destroy performance much more than a slow language, at least if you have a reasonably large dataset. 0 Quote Link to comment Share on other sites More sharing options...
Battlefront.com Posted Friday at 02:07 AM Author Share Posted Friday at 02:07 AM Maybe the code monkey chatter isn't really on topic? On the other hand, I can't contribute much more than I already have so I guess no real harm done! Steve 0 Quote Link to comment Share on other sites More sharing options...
Albert DuBalay Posted Sunday at 07:25 AM Share Posted Sunday at 07:25 AM In the event we don’t get the first battle of France, could we get the LAST battle of France ? French troops assault landing on Oleron Island end April 1945. 1 Quote Link to comment Share on other sites More sharing options...
Centurian52 Posted 18 hours ago Share Posted 18 hours ago On 10/20/2024 at 12:25 AM, Albert DuBalay said: In the event we don’t get the first battle of France, could we get the LAST battle of France ? French troops assault landing on Oleron Island end April 1945. The lack of French forces in CM2 (just a couple of scenarios in CMFI that I'm aware of) has definitely left a noticeable gap in its representation of all eras. It would be great to see MAS-36s, FM-24/29s, 25mm Hotchkiss anti-tank guns, and R35s in action in 1940, MAS-49s and AMX-30s in action in a Cold War setting (still mostly hoping to see the Cold War Bundeswehr in action, but French forces in that era are too unique not to want as well), and FAMASs and Leclercs in action in a modern setting. With the CM2 era coming to a close I'm hoping that CM3 will be able to give us a wider representation of forces and eras than CM2 ever could, including giving us more French forces. Supposedly a lot of the old bottlenecks on productivity have been widened or outright eliminated, so perhaps there's hope. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.