On Sep 14, 2011, at 10:47 AM, Ross Peoples wrote:

> Ok, I think I've narrowed down the problem:
> 
> I put the old db.py file back (the one from the welcome app), then I 
> commented everything. The percentage difference with everything commented out 
> is XML 293% faster. I started uncommenting lines, one by one and running the 
> test with each one. I enabled Mail, Crud, and PluginManager without the 
> number dropping.
> 
> The moment I enabled Auth, the percentage dropped to 267%:
> 
> auth = Auth(db)
> 
> And telling Auth to define_tables dropped the difference between XML and JSON 
> down to 120%:
> 
> auth.define_tables(username=True)
> 
> So something in Auth is preferring XML-RPC over JSON-RPC. Is there some code 
> in Auth that skips over some stuff if the request type is XML or something?

You don't want to be using those overall percentages as the comparison. 
Consider that when you add the define_tables call, you're probably adding a 
large *constant* overhead to all the requests. That will make the *percentage* 
differences of the totals smaller.

For example, if the XML call takes 10ms and JSON takes 20ms, then if that's all 
you're doing, JSON is 200% of XML. Then add something unrelated (db) that takes 
100ms. Now your totals are 110ms and 120ms, and the JSON path is only 109% of 
the XML path.

The less unrelated overhead you have in the request, the more "purely" you'll 
be seeing the XML-vs-JSON differences. 

Reply via email to