directus/directus

Packages using memory even if they are not used

Open

#24,334 opened on 2025年1月7日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)TypeScript (25,193 stars) (3,505 forks)batch import
EngineHelp WantedOptimizationPerformance

説明

Describe the Improvement

While investigating https://github.com/directus/directus/issues/24035 I found multiple packages being loaded into memory even if they were not being in use. The most impactful package was node-xmllint from @authenio/samlify-node-xmllint even though I was not using SAML. But others like openid-client or ldapjs were being loaded as well, but my configuration was not using OpenId or LDAP.

To reduce the memory usage, we could lazy load these and all other packages that are not required if respective configuration is not active. For example, lazy load @tus/server and only import it if TUS_ENABLED is set to true

コントリビューターガイド

Packages using memory even if they are not used · directus/directus#24334 | Good First Issue