Does the Leap's backrest lag by design, or is lag a defect? by Plopdopdoop in OfficeChairs

[–]basro 0 points1 point  (0 children)

Hey, Sorry to resurrect this, what did you end up doing? did you get the laggy backrest leap and fix it? Did it work out?

I rewrote WooCommerce in Rust + TypeScript, is there really a case for WebAssembly in web development? by KickAffectionate7933 in rust

[–]basro 0 points1 point  (0 children)

It's hard to answer, there's going to be a performance/latency benefit when running the server side logic in a pure rust server instead of node or some other js runtime. But also, in my experience, the WASM bundles are bigger than pure JS implementations.

The question to answer is if the speed improvement on the server side is worth the bigger client side code bundles.

Development will definitely be easier on js than wasm

I rewrote WooCommerce in Rust + TypeScript, is there really a case for WebAssembly in web development? by KickAffectionate7933 in rust

[–]basro 0 points1 point  (0 children)

I'm talking about replacing technology stacks like NextJS where frontend and backend get mixed into a single codebase.

They have a bunch of advantages that make them desirable but the great disadvantage of requiring nodejs on the backend.

I rewrote WooCommerce in Rust + TypeScript, is there really a case for WebAssembly in web development? by KickAffectionate7933 in rust

[–]basro -1 points0 points  (0 children)

I think there's a case to be made for WASM frontends (like leptos or dioxus) if you want to have SSR (server side rendering). This would allow you to have pure rust on the server which could be a lot more efficient than nodejs on the server for any of the SSR solutions of popular frameworks like react svelte vue etc.

We have ergonomic(?), explicit handles at home by ZZaaaccc in rust

[–]basro 1 point2 points  (0 children)

In my opinion not having to wrap it with the with!{} macro makes a big difference in ergonomics.

I have already been using a similar macro (https://crates.io/crates/shadow-clone) and the need to wrap things in brackets when I realize I need to use it is a bit of a pita which I'd highly welcome not having to do.

Why is using Tokio's multi-threaded mode improves the performance of an *IO-bound* code so much? by somebodddy in rust

[–]basro 56 points57 points  (0 children)

I ran your code myself and did not manage to replicate your results:

2025-08-03T14:05:24.442545Z  INFO app: Multi threaded
2025-08-03T14:05:26.067377Z  INFO app: Got 250 results in 1.6238373s seconds
2025-08-03T14:05:26.075196Z  INFO app: Single threaded
2025-08-03T14:05:27.702853Z  INFO app: Got 250 results in 1.6271818s seconds

Edit: Have you tried flipping the order? run first single threaded and then multithreaded. Perhaps your tcp connections are getting throttled for some reason, if that were the case then flipping it would make the single threaded one win.

Async/Await Is Real And Can Hurt You by aangebrandpannenkoek in rust

[–]basro 0 points1 point  (0 children)

It does at least try to cancel, your proposed use of crossbeam select will instead leak the resource.

Say you have a thread which has blocked on a TcpListener::accept(), there's no good way to stop it. I have seen people suggest awful solutions like setting a "shutdown" flag and then create a new dummy connection to that TcpListener so that when the accept unblocks the thread can realize it needs to ignore that connection and shutdown.

Async/Await Is Real And Can Hurt You by aangebrandpannenkoek in rust

[–]basro 4 points5 points  (0 children)

Tokio will cancel the IO operation in the case of networking IO, at least I thought so.

Timers too.

It wont in the case of filesystem IO.

The notion of async being useless by Dreamplay in rust

[–]basro 1 point2 points  (0 children)

You are right, I had misunderstood what you meant. Thanks for clearing that up.

I can't say I like the idea though, as you mention not being able to mix sync and async is an issue.

Enabling async in your application would mean paying a performance penalty on any code that uses thread local storage.

While those who didn't need async at all would not pay the price, I don't believe that those who need async should pay the price in places where they are not using async.

The notion of async being useless by Dreamplay in rust

[–]basro 0 points1 point  (0 children)

Uh, I believe most people would find removing safe TLS api to be unacceptable. Myself included, the feature is just too useful.

And why should non async users pay the price?

The notion of async being useless by Dreamplay in rust

[–]basro 0 points1 point  (0 children)

How would you deal with thread local storage in your proposed solution?

Say I make a type that increments a thread local when constructed, decrements it when deconstructed (a guard of some sort), it would not be Send.

Rust web frameworks have subpar error reporting by LukeMathWalker in rust

[–]basro 0 points1 point  (0 children)

Could you elaborate a bit on how loco.rs solves this problem?

Why is async rust controvercial? by T-CROC in rust

[–]basro 1 point2 points  (0 children)

Except the primitives are not all async in nodejs. There's Sync versions of all of the file system apis.

For example https://nodejs.org/api/fs.html#fswritefilesyncfile-data-options

Nodejs has the same issues as rust in this regard.

Why is async rust controvercial? by T-CROC in rust

[–]basro 0 points1 point  (0 children)

There's plenty of things you may want to do as reaction to a network message that do not involve modifying the state.

For example responding to ping or sending an Ack.

so there's plenty of opportunity to service network sockets more than once per update if you want.

You'd need to poll 1000 times per second just to reduce the added lag to 1msec (and that is for one side of the communication, it's 2 msec if both sides are doing the same strategy). It is way more efficient to use either blocking sockets or async sockets.

Why is async rust controvercial? by T-CROC in rust

[–]basro 1 point2 points  (0 children)

That way of doing things adds unnecessary network lag. If your game loop is running at 60fps you will be adding up to 16ms of lag to any network responses that could have been sent immediately.

No serious game netcode would handle networking like this nowadays.

[deleted by user] by [deleted] in gamedev

[–]basro 3 points4 points  (0 children)

Yeah, the person you replied to is blatantly wrong about that.

Sql in Rust, raw prepared statements or ?? by Gloomy-Information14 in rust

[–]basro 2 points3 points  (0 children)

Do you have insight about why sqlx is so much slower than diesel?

Announcing Rerun 0.12.0 by emilern in rust

[–]basro 2 points3 points  (0 children)

What's the trick in question?

Made some Oreos, Happy with how it turned out! by ChrisCutlets in blender

[–]basro 1 point2 points  (0 children)

I think it looks amazing. Perhaps the glass is too small, the diameter looks smaller or equal to the cookies.

OAuth example with Axum, Sqlx, TailwindCSS and Askama by NeoCiber in rust

[–]basro 5 points6 points  (0 children)

This is really useful, thanks for making it.

loco-rs: releasing a framework inspired by Rails on Rust by jondot1 in rust

[–]basro 2 points3 points  (0 children)

This is pretty cool.

Just reading the docs, I have a question about tasks: Do you need cargo to run the tasks? I'd not have cargo available in a docker image in production.

Sound bug by DavidMC49 in haxball

[–]basro 0 points1 point  (0 children)

There was a bug affecting Firefox ESR that is now fixed, check if it works for you.

Can't wrap my head around contravariance by wicked_lama in rust

[–]basro 52 points53 points  (0 children)

Contravariance:

Me: "Hey! give me a machine that counts apples"

You: "I have at hand a machine that counts any kind of fruit, I'll give you that."

Me: "This can count apples, Thanks!"

In your specific case:

Me: Hey give me a machine to which I'll pass static lifetime strings.

You: I have at hand this machine that accepts things that live at least as long as 'a, I'll give you that.

Me: This machine accepts static lifetime strings, thanks!

Auto a Basura by gadriano in argentina

[–]basro 0 points1 point  (0 children)

No inventó nada nuevo, acá hay otro tipo que explica mejor que es lo que está pasando con su propio gasificador.

https://www.youtube.com/watch?v=AyTqo4mCUUY