Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add show-memory-usage script #32

Merged
merged 1 commit into from
Sep 4, 2021

Conversation

mjethani
Copy link
Contributor

@mjethani mjethani commented Sep 4, 2021

The show-memory-usage.js script shows the memory usage of Node.js at various stages of using the publicsuffixlist.js package.

npm run show-memory-usage
npm run show-memory-usage -- --heap-snapshot

Use --heap-snapshot to get heap snapshots for the initial and final stages. Load the .heapsnapshot files in Chrome's developer tools for analysis.

Output:

Initial:
 *  Heap used: 2,372 KiB
 *  Heap total: 4,972 KiB

On import():
 *  Heap used: 2,647 KiB
 *  Heap total: 4,972 KiB

On parse():
 *  Heap used: 5,663 KiB
 *  Heap total: 9,104 KiB

On getDomain('example.com'):
 *  Heap used: 5,672 KiB
 *  Heap total: 9,104 KiB

On getDomain('example.s3-website.us-east-2.amazonaws.com'):
 *  Heap used: 5,678 KiB
 *  Heap total: 9,104 KiB

On getDomain('this.is.a.very.long.hostname.that.does.not.have.a.public.suffix'):
 *  Heap used: 5,682 KiB
 *  Heap total: 9,104 KiB

After GC:
 *  Heap used: 2,542 KiB
 *  Heap total: 7,580 KiB

@@ -0,0 +1,5 @@
node_modules/
Copy link
Contributor Author

@mjethani mjethani Sep 4, 2021

Choose a reason for hiding this comment

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

Note that the .npmignore file is independent of the .gitignore file and replaces the latter as far as npm is concerned.

This file must contain anything that is not to be published.

@gorhill gorhill merged commit a11b3bf into gorhill:master Sep 4, 2021
@mjethani mjethani deleted the show-memory-usage-script branch September 4, 2021 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants