On the advantage of js inertia singleton

see the lazy singleton, saying that it is used to delay the generation of objects, however,
1. What specific scenes did he use it in?
2. What are the benefits of delaying the generation of objects?
also ask friends to give us some advice

Mar.02,2021

can save system resources, and singleton mode can undoubtedly improve system performance for objects that need to be created and destroyed frequently.
is similar to lazy loading


for some objects that need to be initialized for a long time, it can greatly improve the performance of the system
such as node's mysql initialization instance, if the data is initialized every time it is read and written, it is really too slow ~

.
Menu