OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

Performance issues on taxonomy autocomplete #8160

Open MarcoViglione-Laser opened 5 years ago

MarcoViglione-Laser commented 5 years ago

I have a taxonomy with more than 3000 terms. I tried to put a taxonomy field referencing it in my content type, but the autocomplete results take between 5 and 10 seconds to appear. During this time there is nothing telling the user that elaboration is in progress, and if he clicks anywhere else on the page the results are never shown. The method taking a lot of time seems to be GetTerms inside TaxonomyService.cs, which just consists of a contentManager.Query instruction followed by a sort. I even tried to create an index on the column used in the where clause but nothing changed. Considering that this method is called by the autocomplete javascript using an ajax call (through TagController.cs) I would suggest to show a loading spinner starting with the call and disappearing when the results are ready. If you agree with this workaround, I can work on it in the following days.

Skrypt commented 5 years ago

You could maybe also try to index those Taxonomy terms in a separate table so that it retreives only what's needed like we do in OC. I don't remember exactly if we do this in Orchard but if it's retreiving records directly from the main content table then that's probably why it's slow.

sebastienros commented 5 years ago

Fine with a spinner. Can the service also be cached?