I am wondering if someone has researched how much overhead the Django framework will introduce in compare of Google App Engine's simple web framework?
I am planning run some tests and figure out what's the overhead look 开发者_JS百科like and hopefully find out if it has significant impact for an application with the data store (since data store will be the bottle neck).
I would wish to see some results from others before I get my own tests results.
Although you likely have already researched this, I personally would discourage the use of Django on App Engine.
- You have to use App Engine's database api, so you can't use Django's awesome ORM.
- App Engine queries are fairly limited (at least last I looked), as in you can only return a limited number of records for any query, and you can't do much in terms of full text search, or things like LIKE %query%.
- You're very locked into App Engine. While it is a great system, you never know what you'll want in the future.
Though I haven't done actual benchmarks, the overhead should be minimal. You'll just be using Django's URL routing, view system and template engine. If you insist on using App Engine and you like Django's "Model-Template-View" system, I say go for it.
Source code of test project: http://github.com/mave99a/framework-overhead-test
The test is deployed here:
Web app:
http://webapp.latest.robmao-app-01.appspot.com
simple action:
/test-1k/
/test-10k/
/test-1m/
statics file:
/statics/test-1k.html
/statics/test-10k.html
/statics/test-1m.html
Django:
http://django.latest.robmao-app-01.appspot.com
simple action:
/test-1k/
/test-10k/
/test-1m/
direct template:
/template/test-1k/
/template/test-10k/
/template/test-1m/
Results (Jun 20, Robert, Verizon FiOS)
1k
How the result is counted: Run "ab -n 500 -c 100" for 5 times, get the best result of 5 tests.
RPS Static 445 Webapp 363 Django 363 Django template 355
10k
RPS Static 184 Webapp 160 Django 153 Django template 156
1M
RPS Static 9.2 Webapp 11.8 Django 9.5 Django template 13.7
Conclusion: for simple action, the framework's overhead is minimal, almost make no different at all.
精彩评论