Closed pchickey closed 12 years ago
Would switching out the http stuff to a more robust httpd help? Then you would not have to deal with the http side and could focus on the app itself?
Have a front end web app and back end daemon which handles tcp / serial io / logging / etc?
I think Pat has it, SimpleHTTPServer
is a basic, non-multithreaded server. And I've seen the same poor performance.
I think we could switch to using CherryPy or Flask and get better performance, and gain some potentially useful features (off the top of my head: caching, sessions, authorization, templating).
I ported the server to use the CherryPy WSGI server, which is supposed to have good performance, and Flask app support. It's on the cherrypy
branch.
I haven't evaluated it yet to see if performance is any different.
You'll have to install flask and cherrypy to try it.
I've merged this into master.
PageSpeed Insights rated the old version as a 0 out of 100, and rates the new version at 47 out of 100.
New version looks great to me. The startup time is dramatically faster as well - it used to take about 4-5 seconds to start the server (before launching the browser) and now it is nearly instantaneous.
I notice that the more clients I connect to the mavelous server, it can be very slow to load HTML/JS resources for new clients.
I suspect this is because the SimpleHTTPServer we're using doesn't deal with concurrent connections well (or at all?). I'm not too hot with python, but maybe you could look into this, John?