[ckan-dev] slow tags page
David Read
david.read at hackneyworkshop.com
Thu May 17 16:39:33 UTC 2012
Sean,
Hooray! Thanks Sean - it all helps :-)
Dave
On 17 May 2012 17:21, Sean Hammond <sean.hammond at okfn.org> wrote:
>> > The CKAN tags page loads pretty slowly. In our site we have 8000 tags
>> > and on my own machine one page load takes 75 seconds.
>> >
>> > It only recently became this slow, and it seems to be the dictization
>> > of each tag, because all_fields=True in the controller. This is only
>> > necessary when tags have vocabularies or translations. We don't have
>> > those on our site, so I've overridden the controller to make made
>> > all_fields=False. This got my page load down to 2s.
>>
>> Without profiling it I think the problem might be that (if passed
>> all_fields: True) the tag_list() logic action function is calling
>> tag_dictize() for each tag. Looking at tag_dictize(), it calls
>> obj_list_dictize() on each tag's packages as well.
>>
>> There is a tag_list_dictize() function that doesn't dictize the packages
>> of the tags, maybe tag_list() should be using this instead.
>>
>> Background:
>>
>> This is due to the recently added support for multilingual datasets (and
>> tags and groups). A display_name field is added to tags during
>> dictization, they need to have both name and display_name because name
>> will be used in URLs whereas display_name is displayed to users and may
>> get translated by the multilingual_tag plugin.
>>
>> In order for this to work, the tag controller needs to work with a list
>> of tag dicts not just a list of tag name strings as it did before. So it
>> now necessarily dictizes all the tags.
>>
>> See: 73a2b884d423ba584e8c9a985ff6d3380f0690ba
>
> I think this is fixed in master now:
>
> https://github.com/okfn/ckan/commit/968690e5fd3d7bfeff6fa09a7cff09e2ecd98a61
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
More information about the ckan-dev
mailing list