I don't think it would be too difficult to solve. Just use an 'OrderedDict' instead of a regular dict.
http://docs.python.org/2/library/collections.html#collections.OrderedDict On Tuesday, June 11, 2013 9:21:21 AM UTC-7, Aravindan Rs wrote: > > Hi, > > We use web2py in GAE environment and during our performance tuning we > realized that session objects are getting written in every request - even > in requests which do not modify the session object. I raised an issue > regarding this in the web2py issue tracker where I've provided details ( > https://code.google.com/p/web2py/issues/detail?id=1524). After some > debugging I realized that actual session object does not change but the > pickled string changes each time (e.g. order of items is not guaranteed in > a dictionary) resulting is different hash each time which in turn results > in the object being written to DB each time. > > Most of my requests does not write to the session object - still every > request results in write to session table. This impacts my system > performance adversely + incurs higher cost as GAE charges for every DB > read/write. > > I think it is a difficult problem for web2py to solve - I assume I have to > find a workaround in my code. > > I'm thinking of using session.forget() in the right places. I know the > code places where I write to session object. I assume web2py code writes to > session object in login, logout and possibly few other authentication > related flows. Are there other places to take care of? > > Is there a more elegant solution to my problem? > > Thanks and regards, > Aravind. > > PS: Though one can implement the above solution with just "forget" method > - I would have loved also to have "unforget" method - I could have simply > said forget() in one of the model files and unforget() in every place there > is write to session object. > > -- --- 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/groups/opt_out.

