loftar wrote:Mqrius wrote:in some cases it's hundreds of times slower than even java.
"Even" Java? I thought we were past that.
Java is always slower than c++/c/delphi... because of virtual machine. this is the price for multiplatformness.
loftar wrote:Mqrius wrote:in some cases it's hundreds of times slower than even java.
"Even" Java? I thought we were past that.
GreenScape wrote:Java is always slower than c++/c/delphi... because of virtual machine. this is the price for multiplatformness.
GreenScape wrote:but tell me why do game clients using all 100% of the CPU core time? while modern 3D games, run in window mode using only 60-80?
GreenScape wrote:i know many examples java apps is 10x slower than C++ but i don't want to trolling.
loftar wrote:GreenScape wrote:but tell me why do game clients using all 100% of the CPU core time? while modern 3D games, run in window mode using only 60-80?
I've stated it elsewhere on the forum a couple of times, but that's mainly because my usage of OpenGL is very suboptimal. The game client doesn't actually use a lot of real CPU time; it spends a lot of time on the graphics card. That's my fault rather than the JVM's, however.
To be honest, though, I'm not really sure why that counts as CPU time; I would think that waiting on the graphics card's command buffer would put the process to sleep. Though I guess it might be that the latency is so short that the driver spinwaits for the buffer to drain.
Then you're using it wrong.Mqrius wrote:I love python, because it feels easy and natural. I hate it, because in some cases it's hundreds of times slower than even java.
Q.E.D.The backend of the world map is written in python, with an sqlite database.
Now you know why.It works pretty well, but if the project would be any bigger, it just wouldn't be sufficient. sqlite is very bad with concurrency. Right now, when I'm inserting a new batch into the database, you probably can't view the map for a few seconds.
See above.And before I recoded the entire matching algorithm, matching large batches could take over half an hour.
Now that's a bit shortsighted, as well as a little rude. I am very well aware of what parts of my program have what speed, and I do realise that sqlite is not the proper solution here.Granger wrote:Then you're using it wrong.Mqrius wrote:I love python, because it feels easy and natural. I hate it, because in some cases it's hundreds of times slower than even java.Q.E.D.The backend of the world map is written in python, with an sqlite database.Now you know why.It works pretty well, but if the project would be any bigger, it just wouldn't be sufficient. sqlite is very bad with concurrency. Right now, when I'm inserting a new batch into the database, you probably can't view the map for a few seconds.
You blame python but you get your penalties from a 3rd party library.See above.And before I recoded the entire matching algorithm, matching large batches could take over half an hour.
Fucked up code is to blame, not the language you use.
I haven't actually done any speed tests between C and java myself, and the 'even' stemmed from people usually saying something should be coded in C if you want it truly fast.loftar wrote:"Even" Java? I thought we were past that.Mqrius wrote:in some cases it's hundreds of times slower than even java.
I'm placing bets on the Pypy project, from the developers of psyco (no longer maintained, sadly), which aims to be faster than C through a JIT compiler of course, as well as some other features I haven't quite taken the time to look into yet. They're doing pretty well, according to their own stats, but not all modules can be used with pypy out of the box yet. Their project is pretty massive though, but I hope they whip it up into a usable shape sometime soon.kaka wrote:I had placed my hope in the Unladen Swallow project, run by Google, that was supposed to up the speed by 5 times.Mqrius wrote:I love python, because it feels easy and natural. I hate it, because in some cases it's hundreds of times slower than even java.
They never got very far, though, and the results where disappointing.
Granger wrote:Q.E.D.Mqrius wrote:The backend of the world map is written in python, with an sqlite database.
mvgulik wrote:To me this looks like your just calling him a liar. Or do you doubt he knows with what code/tools he created the world map.
Mqrius wrote:And before I recoded the entire matching algorithm, matching large batches could take over half an hour.
Fucked up code is to blame, not the language you use.
The hundreds of times actually came from a different thing I did recently. I was trying to get proper gif palette creation in python (Python Imaging Library sucks), and as such, I ported the java implementation of NeuQuant to python. I did this nearly verbatim, only using numpy arrays instead of python arrays, which should give a decent speed improvement since the arrays can be width*height of image long. However, it was hundreds of times slower than java (java was nearly instant, while in python it took minutes). I then did some work to convert all low level array element messing arounds to list operations from numpy, and this improved it significantly. It's now only tens of times slower than java.Granger wrote:My point is: in case you manage to use python in a way to have it behave hundreds of times slower than java you simply do something terribly wrong.
You say "now you know why" as if you just taught me that sqlite is bad. For one, sqlite is actually very fast. Secondly, I just stated myself that sqlite is bad with concurrency, I'm not unaware of that.Granger wrote:Now you know why.Mqrius wrote:It works pretty well, but if the project would be any bigger, it just wouldn't be sufficient. sqlite is very bad with concurrency. Right now, when I'm inserting a new batch into the database, you probably can't view the map for a few seconds.
Users browsing this forum: No registered users and 4 guests