pragatir / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

Redrawing the whole screen or doing text animations is slow. #78

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Go to http://amuletofyendor.com/nethack/dungeon-crawl-stone-soup/

Try to play dungeon crawl. 

What is the expected output? What do you see instead?

Unless you have fast machine the game goes pretty slow when moving around when 
it's drawing the changed characters. I would expect just drawing text would be 
pretty fast. I ran a javascript profile and all the time is spent in 
VT100.prototype.putString(). I think things could be a little more optimized. 

What version of the product are you using? On what operating system?
2.10 running on debian 64 bit. I tried Firefox and Chrome. Chrome is a little 
faster. 

Original issue reported on code.google.com by superda...@gmail.com on 23 Jul 2010 at 12:11

GoogleCodeExporter commented 9 years ago
There already are a couple of optimizations that work well for applications 
that predominately output text.

Applications that intersperse escape sequences with relatively short runs of 
text are always going to suffer. This is mostly a result of the fact that DOM 
operations are expensive in all current browsers.

If you have any ideas how to improve this situation, I'd be interested in 
hearing about it.

For applications with long runs of text (i.e. for most applications other than 
the one that you were looking at), the biggest cost is usually in the network 
protocol.

Old-school HTML semantics unfortunately restrict the latency and bandwidth that 
we can achieve. I have started work on WebSocket support, which should give 
significant improvements for browsers that support them.

Unfortunately, other real-life responsibilities have prevented me from 
completing this work. Give me a little more time.

Original comment by zod...@gmail.com on 23 Jul 2010 at 12:39