Import modules lazily#658
Conversation
|
On my MacBook Pro M3:
I really appreciate you taking the time to explore this! But so far, I don’t think it’s worth it. Maybe related note: My dream is to switch from Flow to TypeScript and use ESM instead of CommonJS. It feels like moving the |
That's fine, no worries 😊 Let's close this PR then 👍 I think it might still be "worth" to:
What do you think?
Looking at the code I felt like Flow was forcing some odd code (all the ESM can't be used while supporting Node 12/14, right? |
|
I extracted #666 I don’t think there’s anything else in this PR that gives enough bang for the buck, but thanks again for experimenting! |
findClosedElmJson, as recursion in JS is not optimal.--report=jsonor--report=junit.This makes the startup time faster, as demonstrated when running using
--help(usinghyperfine):However, when running regular tests (plain
elm-test, onelmcraft/core-extra), I'm getting worse results:I don't know if my benchmarking is wrong or if lazy imports makes things worse when they're spread out and most of them end up being called. If I end up running
hyperfinewith benchmarks reversed, I usually get diverging results :/However,
mochatests reports the duration of slow tests, and when comparingmocha testson both branches, the new version does seem to yield faster tests.