Thanks Anthony for reply, I will try to reproduce this on dummy app and 
will post it here.


One more thing, I removed join [ ((user_notice.notice = notice.id) AND 
(user_notice.auth_user = 19)) ] from query [ ((((user_notice.notice = 
notice.id) AND (user_notice.auth_user = 19)) AND (notice.status IN 
('Closed','Open','New'))) AND (notice.due_date IS NOT NULL)) ] passed to 
SQLFORM.grid() and checked, It took just 0.1 seconds compare to 34 seconds.

On Sunday, December 11, 2016 at 3:05:30 AM UTC+5:30, Anthony wrote:
>
> Can you post a minimal app that exhibits the same slowdown (maybe add some 
> code using gluon.contrib.populate 
> <http://web2py.com/books/default/chapter/29/14/other-recipes#Populating-database-with-dummy-data>
>  
> to generate some dummy data so we can run it with a similar amount of data)?
>
> On Friday, December 9, 2016 at 11:52:10 PM UTC-5, Gaurav Vichare wrote:
>>
>> I did following steps to upgrade:
>>
>> 1. From admin panel, I cleaned, caches, sessions and errors using 
>> "clean". (also cleaned my browser cache and cookies)
>> 2. Then created w2p package using "pack all"
>> 3. Downloaded latest web2py 2.14.6 from 
>> http://web2py.com/init/default/download
>> 4. Then installed w2p package on web2py 2.14.6 using admin panel
>> 5. Copied web2py.js, appadmin.py, appadmin.html, jquery.js, 
>> web2py_ajax.html, web2py.css from welcome app and pasted in newly installed 
>> app
>> 6. Made few css changes to match old UI
>> Now my complete app is running without any python or js errors.
>>
>> Now when I visit application page containing web2py grid (SQLFORM.grid()) 
>> on web2py 2.14.6, it takes *34.775* *seconds* and on version 2.3.2 same 
>> page with same number of records it takes *0.686* *seconds*. Grid has 
>> around 4600 records. Pages that doesn't have grid, took approx same time to 
>> load on both versions.
>>
>>
>> I did time profiling and found that gluon/html.py is taking most of the 
>> time.
>>
>> Time profiling results
>>
>> 2.3.2 : https://paste.ubuntu.com/23602259/
>>
>> 2.14.6 : https://paste.ubuntu.com/23602261/
>>
>>
>> Also I added print statement before and after grid definition, It took 18 
>> seconds on 2.14.6 and 10 *miliseconds* on 2.3.2.
>>
>> SQLFORM.grid() definition is similar to following:
>>
>> grid = SQLFORM.grid(query,
>>         create=True,
>>         csv=False, deletable=False, searchable=search_query,
>>         showbuttontext=False, links=links, links_placement='left',
>>         maxtextlengths=textlengths, upload=URL('download'),
>>         fields=[db.notice.UIN, db.notice.classname, db.notice.title,
>>                 db.notice.type,
>>                 db.notice.description,
>>                 db.notice.due_date, db.notice.status,
>>                 db.notice.risk, db.notice.consequence,
>>                 db.notice.document,
>>                 db.notice.other])
>>
>>
>> sample query in above grid-
>>
>> ((((user_notice.notice = notice.id) AND (user_notice.auth_user = 19)) AND
>>   (notice.status IN ('Closed','Open','New'))) AND
>>  (notice.due_date IS NOT NULL))
>>
>>
>> I tested this on my local computer- Ubuntu 14.04, Python 2.7.6, 
>> development server and mysql db.
>>
>> Why newer version takes more time to load grid? Anything I missed while 
>> doing upgrade?
>>
>> Please help me to solve this issue.
>>
>>
>> Thank you
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to