Skip to content

Conversation

addaleax
Copy link
Collaborator

Lazy-load most dependencies in the main entry point so as not to have to evaluate their code when running mongosh in very simple cases like --version and --build-info, particularly because the cloud team needs these to be relatively fast.

This results in a ~75% performance improvement for mongosh --version, although it is likely that that difference will be reduced later once/if we enable snapshot support.

(Recommend viewing diff with whitespace disabled)

Lazy-load most dependencies in the main entry point so as not to have to evaluate their code when running mongosh in very simple cases like `--version` and `--build-info`, particularly because the cloud team needs these to be relatively fast. This results in a ~75% performance improvement for `mongosh --version`, although it is likely that that difference will be reduced later once/if we enable snapshot support.
@@ -1,21 +0,0 @@
import { parseCliArgs } from './arg-parser';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still reference to lib/index.js in package.json, we probably should remove it now that this file is gone? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you 🙂

@addaleax addaleax merged commit f67d5c3 into main Feb 17, 2023
@addaleax addaleax deleted the 1336-dev branch February 17, 2023 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants