The Sitecore.Demo.Retail codebase is a work in progress that is aimed at adhering to Sitecore Helix principles and favours maintainability over performance improvements. The Sitecore Reference-Storefront on the other hand has many performance optimisations. Both code bases are reference implementations of Sitecore Commerce sites.
If you are using the retail demo site as a reference for your site, consider these changes:
- Override controller action session state behaviour
- Read about it here – http://www.c-sharpcorner.com/UploadFile/ff2f08/session-state-behavior-per-action-in-Asp-Net-mvc/
- Here are a few links in the reference storefront implementation:
- Storefront/Common/Project/Infrastructure/StorefrontSessionStateAttribute.cs
- Storefront/Common/Project/Infrastructure/WindsorControllerFactoryBase.cs
- The Reference-Storefront Developer Overview doc in chapter 9.6
The Reference-Storefront Developer Overview doc in chapter 9 (the last chapter) has a number of other performance optimisations you should consider.