New and improved Nop Ajax Filters released
Last week we had an interesting case with a nopCommerce 2.2 customer, who reported a fairly slow performance of the Nop Ajax Filters. We were suspicious at first. The filters are supposed to be faster than the normal nopCommerce retrieval of products for a category after all! Nevertheless we took on our client's database and ran some tests, and it turned out that the filters were running slowly indeed. The database contained over 5000 SpecificationOption records for 254 SpecificationAttributes and 21242 Products. Serious business!
So we got down to see what is going on, bearing in mind that our nopCommerce plugin was heavily dependent on LINQ and EF Code First. It turned out that while EF Code First is great for development, you should be very careful when working with a large set of entities. For example the simple retrieval of an entity property, for example Product.SpecificationAttribute, results in a database call. Add to that Product.SpecificationAttribute.SpecificationOptions and you have another database call. The Nop Ajax Filters depend heavily on these Product - Specification mappings. So you can probably imagine how a fairly complicated algorithm for filtering products and determining specification options availability can unwittingly run into performance problems.
Fortunately with a more careful use of EF and LINQ performance issues can be fixed fairly easily and the resulting speed can be comparable to a stored procedure implementation.
So we are glad to announce that the focus of this Nop Ajax Filters release is a performance optimization, resulting in the filters running more than 80% faster.
In addition to that we have opened the filters views. This means that the filters can now be modified via Razor and MVC Action Filters. Such a modification could be having the filters organized in dropdowns instead of checkbox groups, something which seems to be quite a requested feature by nopCommerce users.
Please stay tuned for more news on our nopCommerce releases, themes and plugins!