A shared library that loads only what each service needs
Services loaded a whole utility library to use a few parts of it. I designed a modular import structure so each service loads only the modules it needs. It was adopted company-wide and cut memory use by up to 20% across all backend services.
What each service loads
Before: services load everything
module amodule bmodule cmodule dmodule emodule f
Serviceloads the whole library
After: services load what they use
module amodule bmodule cmodule dmodule emodule f
Serviceloads only two modules
At a glance
- Memory use
- Up to 20% lower
- Adoption
- Company-wide
- Before
- Entire library loaded
- After
- Only needed modules