Skip to content

Commit

Permalink
Add performance note to README (Close #44)
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitchell committed Apr 15, 2024
1 parent 433b5d5 commit 0bf80b1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ assert(correct('GPL-3.0'), 'GPL-3.0-or-later')
assert(correct('GPL-3.0', { upgrade: false }), 'GPL-3.0')
```

## Performance Note

This package load and processes the `spdx-license-ids`
package, as well as a few other large arrays of strings,
into global variables. That can take a few milliseconds.

If you'd prefer to postpone that processing until your
program actually invokes the exported function, consider
using `require()` or dynamic `import()` to load the package
just before you invoke it.

Special thanks to Vinicius Lourenço ([@H4ad](https://github.com/H4ad))
for investigating load times.

## Contributors

spdx-correct has benefited from the work of several contributors.
Expand Down

0 comments on commit 0bf80b1

Please sign in to comment.