Title could be improved, as I was wondering if the command line tool npm had itself been rewritten. It’s actually one of npm’s web services that was rewritten. FTA: “Java was excluded from consideration because of the requirement of deploying the JVM and associated libraries along with any program to their production servers. This was an amount of operational complexity and resource overhead that was as undesirable a…
Also with GraalVM you may get away with building a native image which doesn't require a JVM at all.
Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
151–160 of 307 posts
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#152Earlier quoted context omitted.
A team that likely has lots of JavaScript expertise basically stated that JavaScript is unsuitable for their task. And that the operational improvement once written in Rust was notable enough to write a paper. Imagine the K8S team porting from Go to some other language for similar reasons.
The k8s team probably should, judging from the state of their codebase.
Every projects of that scale are going to have issues.
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#153Earlier quoted context omitted.
Rust's package managment (cargo) is the best thing I have ever seen of it's kind. The very basic thing you can do is: cargo new funkyproject Which creates a new barebones rust project called "funkyproject". Every dependency specified in it's Cargo.toml will be automatically downloaded at build (if there is a new version). When a build is sucessful the versions of said dependency will be saved into a Cargo.lock file.…
That sounds pretty similar to NPM, as well as NuGet and Paket for .NET. TBH, it's the 'obvious' way for a package manager to work, so I'd be a little surprised if they didn't all work more or less the same?
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#154Earlier quoted context omitted.
I'm not a fan of relying on distro package managers for installation of runtime dependencies on servers. Too many opportunites for variables to creep in if the version isn't locked, and then having to make sure all the package manager dependencies and config themselves. Even if you automate you're still at the mercy of the repo to have the version you need etc. and often times you need to customize the install for a…
What's the alternative? Not installing the dependencies so the app doesn't work?
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#155Earlier quoted context omitted.
I'm not a fan of relying on distro package managers for installation of runtime dependencies on servers. Too many opportunites for variables to creep in if the version isn't locked, and then having to make sure all the package manager dependencies and config themselves. Even if you automate you're still at the mercy of the repo to have the version you need etc. and often times you need to customize the install for a…
What's the alternative? Not installing the dependencies so the app doesn't work?
Either way the runtime is baked into the app and gets deployed and tested with it as a core component. Runtime upgrades then become vanilla deployments.
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#156Earlier quoted context omitted.
How it isn't? You just explained it quite well. Not to mention that the Web is now full of discussions around this, with official posts from Oracle, Red-Hat, Amazon, IBM, Azul, Microsoft explaining how to go forward.
Figure out what you would pay if you used it in an elastic ECS setup. Using only Oracle documentation as a guide :)
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#157> Java was excluded from consideration because of the requirement of deploying the JVM and associated libraries along with any program to their production servers. This was an amount of operational complexity and resource overhead that was as undesirable as the unsafety of C or C++. Just so everyone here is aware, this is by now an outdated complaint against Java. https://vertx.io/blog/eclipse-vert-x-goes-native/ I'm…
Are there any companies using these native images in production?
The below videos show GraalVM based app loading up Spring framework, and flowable process engine and making a rest call to an external service all in 13 ms!!!
Checkout
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#158Earlier quoted context omitted.
Which is roughly the equivalent of every single human being downloading two npm packages per week. To me, this suggests that the real problem is that too many packages are being downloaded.
Yep, not that surprising though, given the anemic state of the JavaScript standard library.
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#159Earlier quoted context omitted.
I'm not clear on why this is particularly CPU heavy, though: "the authorization service that determines whether a user is allowed to, say, publish a particular package"
Lots of users. Anything will be CPU-heavy if you give it enough work. Except the things that end up being memory-bound instead, but the NPM database isn't large enough for that.
Not in a relative sense. If authorization is 5% of the work, scaling it leaves it at 5% of the work, and it's never a bottleneck. Authorization was being a significant bottleneck, not a tiny percent, and that is somewhat surprising.
Re: Case Study: Npm uses Rust for its CPU-bound bottlenecks [pdf]
#160This entire article is a pretty damning report on JavaScript in general, but this sentence takes the cake (emphasis mine): > The process of deploying the new Rust service was straight-forward, and soon they were able to forget about the Rust service because it caused so few operational issues. At npm, the usual experience of deploying a JavaScript service to production was that the service would need extensive monito…
Perhaps Rust's name is apropos: your code will be so reliable that you won't need to look at it again until it has collected rust on its thick iron framework.