Taxonomy Module Performance Issues?

Topics: General
Jan 30, 2014 at 2:36 AM
Anyone know of any performance issues with the taxonomy module or perhaps know of any best practices on performance when using it?

I was profiling an Orchard 1.7.1 website that uses taxonomy and noticed a very chatty, taxonomy-related conversation constantly going on between Orchard and the database. It seemed to cause the website to perform noticeably slower.

I haven't used the taxonomy module a lot recently, so I am wondering if there can be performance issues in certain circumstances, what those circumstances may be if any, and if there are best practices when using it.

Feb 19, 2014 at 3:49 PM
I've encountered major performance issues with Taxonomies too, and traced the cause to the following:
 public IEnumerable<TermPart> GetChildren(TermPart term)
            var rootPath = term.FullPath + "/";

            var result =
                _contentManager.Query<TermPart, TermPartRecord>()
                        new QueryHints().ExpandRecords<AutoroutePartRecord, TitlePartRecord, CommonPartRecord>())
                    .Where(x => x.Path.StartsWith(rootPath))
                //THIS WAS THE PERFORMANCE FIX ^^^^ - moving the where before .list() 
               //to prevent all taxonomies being brought into memory!
Not sure if this has been fixed in later versions (I was using version 1.70), and maybe this StartsWith() function won't work with some non SQLServer databases?

I think a better long term solution is that all taxonomies are stored/cached in memory permanently, though I guess 1.8x document database work might mitigate these kind of performance issues too.