@crunklord420@alex@graf@lain@mint I agree btw that nobody (afaik) said to do this before now. Well, I did but I didn't take my own advice for mediaproxy, but only because I thought it would be harder than it was because I didn't see the option in the docs (maybe that is because I am stuipid though.)
@alex@lain@graf@crunklord420@mint@Moon every single javascript engine is slow as shit,nodejs is written and C and uses libuv underneath.it doesnt matter if the runtime is written in rust or whatever because the js that runs on top of it requires gigabytes of RAM to do anything because of so many layers of garbage thats tangled together.
@n-2-l@lain@graf@crunklord420@mint@Moon I'm bridging two entire decentralized social media protocols on a single thread of TypeScript code in Deno, serving about 4GB of data per day, and the whole VM including my code and OS are consuming about 400MB of RAM and maybe 10% of the CPU.
@alex@lain@graf@n-2-l@mint@Moon almost everything I run is never CPU bottlenecked, and that's a bad thing. They're always IO bottlenecked, pleroma, matrix, everything. The CPU is literally just sleeping while waiting for data to move from disk to ram to CPU. If the software was good that data would be in CPU cache, it would be in memory, it wouldn't be on disk. It wouldn't be constantly doing system calls to the kernel and sleeping on mutexes.
If the software was good, it'd be using 100% on all cores.
> fundamentally speaking it will always be inferior to a non-VM, non-GC'd language.
Bullet-point meme objections. GC's fine, Pleroma's not memory-bound. VM's fine, it's not CPU-bound either. It's I/O-bound, leans hard on Postgres. Maybe we should add manual memory management to Postgres, start shipping binaries to the DB instead of letting it parse queries. Why bother with Rust anyway? C ticks off the same bullets and the compiler doesn't take a year to run.
@p@lain@graf@mint@Moon security isn't the reason I want it rewritten in Rust. It's because I refuse to learn Elixir and fundamentally speaking it will always be inferior to a non-VM, non-GC'd language.
Mitra has the right idea just going ahead and using Actix. Actix/Tokio will absolutely annihilate whatever routing framework Pleroma uses (Phoenix?) .
Rust is the worst for "all this shit would be better if you people adopted my preferred silver bullet". You hand a browser text headers, you could do it in brainfuck. Rust is shit, won't fix a damn thing.
@loathsome@p@lain@graf@mint@Moon there's two answers to this. The real world answer and the academic answer. In the real world the idea of copying large arrays over and over instead of using state and mutability is totally orthogonal to writing performant code.
Have a look at that. I don't have to pass around large arrays, I can just pass around lazy iterators. But I'll forgive you for not knowing this, since you admit to actively not wanting to learn the thing you are talking about.
And obviously making copies of small chunks of information has no meaningful impact on performance.
At the end of the day, languages are tools. You choose the right tool for the job. Elixir is designed to build concurrent, fault-tolerant code and it's absolutely great at this. It can be used for other things as well, but I wouldn't build an operating system with it. It's "good enough" for it's intended purpose. You can obviously be an autistic faggot that thinks any abstraction away from binary code is "orthogonal" to how computers work, but that is akin to only having a hammer and seeing all problems as nails.
@p@lain@graf@mint@Moon Pleroma is I/O bound partially because it was written in a language specifically designed to be incredibly slow and wasteful when it comes to reuse of memory.
It cannot be repeated enough. Functional programming languages are totally orthogonal to how computers actually work and you can never take advantage of the properties of a computer if you view how a computer actually operates as a flaw that requires a rube goldberg machine to pretend doesn't exist. But of course, never will cease to exist because ultimately you are trying to get a computer to do a thing, not just turn on and get warm (as the intended purpose of functional programming languages).
Lambda calculus is Turing complete. I have no idea how functional programming is "totally orthogonal" to how computers actually work. Feel free to explain.
@i@p@lain@graf@crunklord420@mint@Moon i know all the instances mainly get bottlenecked by db writes, but what I don't understand is why? Is it because they don't cache enough in RAM before writing to disk or is it just structured inefficiently so that it has to update more stuff than it should? I feel like something must be missing because a lot of other software out there that uses postgresql doesn't seem to have these problems.
@crunklord420@p@lain@graf@mint@Moon phoenix/cowboy would be the equivalents, they're not bad, but pleroma is absolutely gimped by postgresql not keeping up with the buckets of json
> i know all the instances mainly get bottlenecked by db writes, but what I don't understand is why?
Reads and writes. Part of it is the massive volume of really messy data (messy data always adds overhead but is usually unavoidable in big, distributed, heterogeneous networks), part of it is the architectural decision to keep objects around in their original forms instead of losing data like Masto does.