New on Shopfront: August 2020

Welcome to what’s new on Shopfront for August 2020! This month is full of information display adjustments as well as some major performance improvements!

Performance and Memory Improvements

Over the course of this month we’ve had a focus on performance and memory related improvements and have made some significant gains.

First we looked at how our indexing works as we know that memory takes a large hit whenever that runs and it can run quite often (any modification to a product, customer, promotion or price list runs the reindexing process for the respective change). We keep an index to make searching fast and allows us to provide a dynamic search (such as searching from the middle of multiple different words).

To improve this we took a critical look at when we need to reindex our data and came up with a strategy to perform a “rolling” update which batches changes together.

After implementing the batched rolling update we then looked at which “browsing contexts” require the index and we’ve prevented a number of pages from performing a reindex until you’re back in a page which does require the index.

Both of these changes has lead to a large improvement in both memory usage and performance, but we’re not done yet.

Prior to this month our icons were loaded using a technology called SVG, this is a very common way to load icons and is great to do a number of transformations to the icons (such as masking and recolouring), however it comes at the cost of a small amount of memory per icon, when you have a small set of icons this memory usage is negligible, however Shopfront currently features over 350 icons so that memory usage stacked up. In order to combat this, we’ve moved our icons from SVG and instead made them into a “web font” which forces the icons to load like a normal font does. As soon as this was implemented we saw a huge reduction in memory usage.

Finally we looked at Shopfront as a whole, previously when you load Shopfront you load all of Shopfront, however you might just be in the register for the day so you don’t need the order modification or settings pages to be loaded in the background. Using a technique called “lazy loading” we have started moving a number of pages to load only when the page is visited. Now this is expected to come with a performance penalty of loading the page, however due to the way Shopfront was designed to work offline we precache all of the page data on your hard drive so you never see the page loading.

After finishing these performance and memory improvements we decided to measure them against some other popular applications and have found that our memory usage is now below Gmail, Jira, Zendesk and Facebook.

Minor Features

Whilst a major focus has been on overall Shopfront performance, we’ve made quite a few other minor adjustments, here are the key changes:

  • You can now optionally specify tags to show revenue of when closing the register (customise this in the Registers & Outlets settings page),
  • We’ve replaced the select dropdown component with a brand new lightweight version,
  • The price calculation is now quicker when product quantities are greater than 100,000 by swapping to an approximate method rather than an exact price calculation,
  • The product view page now shows the product’s status next to its name if it’s not active,
  • Duplicate product dialog for express & advanced stocktakes as well as the order edit screen now shows if an included product is inactive,
  • Sales history now defaults to the current Outlet you’re in if you’re a multi-store Vendor,
  • The roles & permissions page now shows how many users belong in each role,
  • A new permission to prevent users from clearing local data from within the POS was added,
  • Reduced maximum amount of products and customers to display in the sell screen search to 300 to improve memory usage and loading time,
  • The customer view page now shows the group it belongs to,
  • Inactive products have been removed from the promotions sale key,
  • More information has been added to the login news,
  • Order reference is now an available column for advanced reports,
  • The promotion view page now shows the Outlet(s) which the promotion is applied to,
  • Advanced stocktake now allows entry of “0” as a quantity,
  • When multiple of the same products are unconsolidated on the sell screen we now distribute the prices using the family price distribution rules,
  • The sync no longer paginates the parked sales and instead returns them all at once resulting in a large performance improvement on pages after the first,
  • Customer statements can now be run if you have the See Customers permission (previously you could only run them if you had the Modify Statements permission),
  • Transferees can now store contact details and automatically email transfers,
  • Vendor connections have gained the option to specify how the connection data should be received (either as an order / invoice or a transfer),
  • Details of a invoice return are now able to be modified,
  • [MYOB] The integration has been completely rewritten in TypeScript and now features better error recovery and a new validation system,
  • [Developer] Viewing application history is now significantly faster

Bug Fixes

  • Prevented multiple sell screens from being opened after removing a previous duplicate sell screen,
  • Stocktaked products report was previously showing the current date for products that have never been stocktaked instead of “Never”,
  • Fixed promotions endlessly reindexing resulting in a memory leak,
  • Lines on orders which contain a different case quantity between the Shopfront product file and the order now correctly adjust the quantity when changing case quantity to one,
  • Opening the browser when in global mode no longer forces register selection,
  • Prevented payment of a sale while a product is being added when both hard drive and CPU are at 100%,
  • Orders & Invoices now shows correct orders when navigated to when in global mode,
  • Gift cards can now be removed after they have been added to a parked sale,
  • Sales summary in product view now correctly shows all sales when in global mode,
  • Performing a customer payment with a large number of sales no longer results in the rate limiter being hit,
  • Logout is no longer forced after two hours from last login, instead it’s now two hours from last interaction with Shopfront