Other things to look for are related to concurrency:

- Table, record locks
- concurrent threads
- long db transactions

one thing you should try first is to stop web2py completely and see if
using a single process from the commandline makes any difference.
I mean using command line like:

$ python web2py.py -M -S <your app name here>

and then run your code.




2014-03-13 21:47 GMT+01:00 Jonathan Lundell <[email protected]>:

> On 13 Mar 2014, at 1:38 PM, horridohobbyist <[email protected]>
> wrote:
>
> Yes, same machine, same installation. All I did was move the module from
> my test directory to web2py's site-packages folder. Then I copied the main
> program into my default application controller. *The same code is
> executing*.
>
> Just to be sure I'm not going out of mind, I printed out the elapsed time
> for each iteration in the main program (for both the command line execution
> and the web2py app execution). Lo and behold, the elapsed time for each
> iteration is much longer under web2py.
>
> Note that pyShipping is a pure Python implementation. The Python
> supporting libraries **should** be the same in both instances.
>
>
> Probably, but not necessarily. It could be that because of differences in
> sys.path there's a difference in whether some basic libraries like pickle
> vs cpickle (to pick a really random example) are getting loaded.
>
> Not a diagnosis; just a possibility, maybe a remote one. If you're doing
> elapsed-time measurements, you might build a list of timestamps of
> intermediate steps, and then print that.
>
>
> I do note, however, that when I tried to incorporate the code into web2py,
> I found a namespace clash (class Package appears elsewhere in the web2py
> installation). I resolved this by renaming the module file. Otherwise,
> there should be no difference between command line execution and web2py
> execution.
>
> Thanks.
>
>
> On Thursday, 13 March 2014 15:54:37 UTC-4, Jonathan Lundell wrote:
>>
>> On 13 Mar 2014, at 12:48 PM, horridohobbyist <[email protected]>
>> wrote:
>>
>> I have a rather peculiar Python performance issue with web2py. I'm using
>> pyShipping 1.8a (from http://pydoc.net/Python/pyShipping/1.8a/). The
>> standalone program from the command line works quickly. However, after I've
>> incorporated the code into my web2py application, the same pyShipping code
>> takes orders of magnitude longer to execute!!! How can this be?!
>>
>> I presume in both instances that "pre-compiled" code is being run.
>>
>>
>>
>> Same machine, same Python installation? If not, maybe C vs Python
>> supporting libraries?
>>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to