Magento 2, like its forbearers, starts to fall apart when you push larger amounts of data through its systems. One example of this is Configurable Products. Configurable Products allow users to pick options for a product (size, color, etc.), and have each configuration mapped onto a single Simple Product entity. In theory, there’s no limit on the number of simple products you can link to a configurable. In practice, Magento’s UI rendering code starts to choke when the number of simple products attached to a configurable product starts getting into the thousands. Certainly not the standard case, but its not exactly an uncommon use case for Magento users.
The elgentos/LargeConfigProducts module takes a stab at fixing this. From the README
In the frontend, Magento 2 loads all variations (associated simple products) in a giant JSON object and renders that into the DOM. This JSON object is 20 megabytes for 10k variations.
In the backend, this JSON is also built and passed to a UI component wrapped in XML. PHP’s xmllib is not able to append extremely large XML structures to an existing XML structure.
We have created workaround for both problems. In the frontend, we offload fetching the JSON blob through an AJAX request.
In the backend we use DOMDocument’s and the
LIBXML_PARSEHUGEconstant to handle the extremely large XML structure.