[vworld-tech] RE: Python/java for the back end

Alex Chacha achacha at hotmail.com
Sat Apr 30 17:48:40 PDT 2005


Brian Hook wrote:
>>For my latest project I wanted a quick and dirty backend code so I
>>can concentrate on the questing and crafting engine, all was well
>>initially and then I did a small 10 client load test and saw that
>>it just did not scale well at all.
>
>Why?  Did you profile this?  I can't see how a 10 client load test would 
>fail even with something catastrophically slow.

I did not expect it either, there was a lot of computation (determining 
resource trees and tradeskill products), the tradeskill system is very very 
dynamic and with enough resources it can be quite a CPU hog, lots of fun to 
play with it but it's CPU intensive.  My CPU was 100% for the whole test, 
compared to abot 10% on a C++ implementation.  That aside, I am still using 
the python code as a test interface to the engine and it works well.  Why 
waste a pergfectly good python implementation, just find a new use for it.


>>Given that I did more testing with java and managed to improve
>>performance by only using 10 worker threads and managed 50 client
>>load before I started noticing lag.
>
>Did you just try doing this as a single threaded server with network 
>marshalling at the top of the main loop?  This has worked very effectively 
>for me in the past and dodges a lot of the problem associated with 
>multithreading the server (and associated threading problems found with 
>many languages).

I had 10 listener threads per client.  I since switched to 1 listener and 10 
worker threads and a simple queue system.  It worked well with both java and 
C++, but I stuck with C++ since the code is CPU intensive I want to make 
sure I am getting maximum performance out of it.  I am at the point where I 
am testing the performance of msvc and g++ optimizers and profiling the code 
heavily.

Java makes a lot of the coding easy at first but I (personally) find it 
tough to give up performance knowing well that once I start increasing the 
game engine complexity I will start to feel the performance bottlenecks.




More information about the vworld-tech mailing list