5 ms·
Node.js – v20.8.0
- halfmatthalfcat 3y agoI don't love the loader hooks change with `register`. Was much simpler to leverage the command line flag `--experimental-loader` and pass in the file that exports the hooks. Now I need another file that basically just calls register against my loader file.
- pier25 3y agoIs this for the ESM custom loaders?
- halfmatthalfcat 3y agoYeah, it is. Glad they've moved it to RC status but the API has gone through a ton of flux.
- eyelidlessness 3y agoI haven’t touched module loader hooks for a while, but my impression is that the changes bring it more conceptually in line with require hooks. Loader authors will likely provide the register call for end users (to load with --import, roughly analogous to loading require hooks with --require?), so you won’t need to call anything in an extra step unless you’re authoring a loader yourself. In which case this provides for composition patterns which the earlier CLI-only entry (mostly) didn’t.
- derN3rd 3y agoJust thought that the `This rework addressed a series of long-standing memory leaks and use-after-free issues in the following APIs that support` part will finally solve memory issues with jest, but Simen Bekkhus already posted that it's still an issue... (https://github.com/nodejs/node/issues/35375#issuecomment-1740747711 https://github.com/nodejs/node/issues/35375#issuecomment-174...)
- jmull 3y agoThat's linking to a performance issue, but the nodejs fixes were about memory leaks and use-after-free. So it sounds like different issues.
- inglor 3y agoThere is already a PR on the way to fix the performance regression with what Jest s doing https://github.com/nodejs/node/pull/49950 https://github.com/nodejs/node/pull/49950 Note we also ship a test runner ourselves pretty recently and it may suit your needs.
- thefilmore 3y agoThis is very timely. I was profiling some code a few days ago and noticed streams were much slower than expected.
- inglor 3y agoWe have at least ±5 more changes on the way to improve streams significantly (Node streams, then web streams), reduce the size of each stream and hot-path common cases.
- janderson215 3y agoThat’s great news, thank you! Offtopic nitpick: I think you mean to use ~ as the symbol for approximately. I noticed it in the release notes, as well. I would be mistaken.
- thefilmore 3y agoThat's fantastic!
- andymac4182 3y agoWill these make it into v20 or will we need to wait till v21 as LTS isn't far away.
- idbehold 3y agoOne thing that bugs me about the "140% improvement" PR is that even the author only has some hand-wavy theory as to why that change from local variables to an object with those two properties made such a drastic improvement. V8 performance (well, let's be honest, any JS runtime's performance) is just a bunch of guess and check work.
- xwowsersx 3y agoIt's definitely unsettling when we don't fully understand why a fix works. I suppose one could argue that, in that sense, software development is as much art as it is science... you learn and adapt, and over time, the understanding of why certain fixes work may become clearer. I wish I could remember the specific instances of this throughout my career, but I remember at least a few where we were happy to have the fix (even though it was annoying we didn't understand the why) and then months or more later we came to fully understand why. I distinctly remember how, in many of these cases, it felt to us like it would've impossible to even come close to the why without first just having the fix. That's what made it even more frustrating — that we felt we needed to understand the underlying issue in order to fix it but then it felt like there's no way we would've understood what the underlying issue was without the fix! In that way, it kind of all just felt like luck or a miracle...which is definitely not very confidence-inspiring.