I see the problem. You either tried this without GAE or you used your own gaehandler.py instead of the provided one.
If compileapp does not find settings.web2py_runtime in ['gae:production','gae:development'] it will assume NO GAE and only cache the model source (which is not really necessary anyway). Else if it detects GAE it will cache bytecode compiled models and actions. I just tried and it works. Massimo On Apr 13, 10:09 am, Robin B <[email protected]> wrote: > Looks good, but I tried inspecting 'cfs' to verify that it is caching > the ccode: > > in controller/default.py: > > from gluon.compileapp import cfs > def index(): > response.flash = BEAUTIFY(cfs) > return dict(message=T('Hello World')) > > The results were not what I expected. Only the model db.py was > cached, even on subsequent requests, and the cached value was the text > file contents not the ccode! Unless I am misunderstanding, I do not > see how this provides speed up. > > There is another little typo in gaehandler.py log_stats(): > > The time formatting should be: > > log_info = """**** Request: %.2fms/%.2fms (real time/cpu time)""" > > Robin > > On Apr 13, 12:07 am, mdipierro <[email protected]> wrote: > > > OK. done. check the trunk and let me know what you think. I am also > > reposting this as 1.61 for now because 1.60 may be broken on GAE. > > > Massimo > > > On Apr 12, 12:35 pm, Robin B <[email protected]> wrote: > > > > There is a problem, GAE does not allow setting os environ variables > > > (they are read only for security). > > > > os.environ['WEB2PY_RUNTIME'] = "GOOGLE" # will not have any effect. > > > > Instead of os.environ, how about a web2py.environ global dict which > > > serves the same purpose and works on GAE? > > > > Also the logstats decorator in gaehandler.py can be used to measure > > > speedup, but there is a typo in the code: > > > > <<<<<< > > > (ti, c1) = timer(time) > > > ======= > > > (t1, c1) = timer(time) > > > > Robin > > > > On Apr 12, 11:26 am, mdipierro <[email protected]> wrote: > > > > > I did what you suggest. Please give it a try. If the imp.get_magic > > > > works on gae then web2py may have been slower on GAE that it is > > > > supposed to be. This should fix it. > > > > > Massimo > > > > > On Apr 11, 7:59 pm, Robin B <[email protected]> wrote: > > > > > > I am not sure if that is true or not. > > > > > > To test for GAE, I would set 'is_gae' to True in gaehandler.py to > > > > > achieve fool-proof detection. > > > > > > To detect production/debug on GAE, I use this in 0.py: > > > > > > response.debug = os.environ.get('SERVER_SOFTWARE','').startswith > > > > > ('Devel') > > > > > > Robin > > > > > > On Apr 11, 2:59 pm, mdipierro <[email protected]> wrote: > > > > > > > Is this still true on GAE? > > > > > > > try: > > > > > > magic = imp.get_magic() > > > > > > except: > > > > > > is_gae = True > > > > > > else: > > > > > > is_gae = False > > > > > > > If not. How can we fix it? If this not true any more it may be > > > > > > causing > > > > > > a major slow down on GAE. > > > > > > > Massimo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

