←
Patrick Walton12,879 posts
Patrick Walton avatar

Patrick Walton

@pcwalton

Programming languages and graphics person. @pcwalton.bsky.social

◷ Joined November 2009▧ 215 Photos and videos
Patrick Walton avatar
Patrick Walton@pcwalton·13 Dec 2024

Landed multi-draw-indirect and bindless textures in Bevy 0.16! It cuts our CPU overhead for drawing in half on many scenes, and along with the retained render-world scene graph I also landed it brings us significantly closer to GPU-driven rendering.

Patrick Walton avatar
Patrick Walton@pcwalton·2 Dec 2024

One thing that would make Rust compiles faster in many cases is for Cargo to insta-kill any rust-analyzer processes when you run cargo build. That "Blocking" message wastes a lot of time.

Patrick Walton avatar
Patrick Walton@pcwalton·29 Nov 2024

Sorry, but at this point if you think Bevy's ECS is a burden for app logic I just don't believe you. You have to organize your code somehow. The question is whether the framework helps you do it or not.

Patrick Walton avatar
Patrick Walton@pcwalton·29 Nov 2024

Bevy 0.15 is out :) This time around, I wrote animation masks, additive blending, most of the Bevy Remote Protocol, chromatic aberration, point light and spot lights for volumetric fog, and PCSS.

Bevy 0.15 is out now! It features Required Components, Entity Picking, Generalized Entity Animation, Animation Masks, Curves, Function reflection, Bevy Remote Protocol, VBAO, OIT, Chromatic Aberration, Fog volumes, Better Text, and more! bevyengine.org/news/bevy-0-1…

Patrick Walton avatar
Patrick Walton@pcwalton·19 Nov 2024

Idly wondering if Objective-C/Swift have precise enough reachability information to try running a Bacon cycle collector if memory is running low.

Patrick Walton avatar
Patrick Walton@pcwalton·18 Nov 2024

Wanted: a `#[derive_fast_hash]` that gives you a fast hash and compare implementation that goes as many bytes as it can at a time, for types with no padding anywhere (the macro would guarantee this somehow).

Patrick Walton avatar
Patrick Walton@pcwalton·16 Nov 2024

The iOS ecosystem has gotten so close to having true JIT support on iOS that I'm not sure that the delta between all the workarounds and true JIT support is that meaningful anymore. You can already JIT in wasm or JS, or you can interpret, or you can get a JIT entitlement...

Patrick Walton avatar
Patrick Walton@pcwalton·28 Oct 2024

I don't think 5 insns is feasible, but you might be able to get to around 10. Load TLAB, load bin, check to see if bump mode/pop mode/slow path, bump or pop as necessary.

Patrick Walton avatar
Patrick Walton@pcwalton·28 Oct 2024

Also consider malloc logging/tracing features. Very convenient! But it adds a runtime check on every allocation. When your point of comparison is ~5 instructions as in the JVM, those tiny branches add up.

Patrick Walton avatar
Patrick Walton@pcwalton·28 Oct 2024

A lot of C++/Rust malloc overhead comes from the loosely coupled malloc(size_t) interface. For example, the allocator has to compute which bin to use at runtime, when most of the time the compiler knows the size and could precompute the bin offset.

Patrick Walton avatar
Patrick Walton@pcwalton·28 Oct 2024

... which tend to be programs that have been optimized to remove all unnecessary allocations. So native mallocs aren't good at throughput of lots of tiny allocations, since their workloads don't do that. But making malloc better here would certainly make writing C++/Rust easier!

Patrick Walton avatar
Patrick Walton@pcwalton·28 Oct 2024

Honestly, I feel like programmers are way too quick to assume that "allocation" = "slow" is an iron law of the universe. In the JVM it's like 5 instructions. The problem with C++/Rust allocators is that they're tuned to the workloads they observe in programs... (1/2)

zack@zack_overflow27 Oct 2024

This is why Zig and Rust are sane and C++ is crazy Just assigning a variable to another can cause heap allocations I imagine std is littered with all these hidden allocations Imagine how hard it must be to write performant software

Post attachment
Patrick Walton avatar
Patrick Walton@pcwalton·24 Oct 2024

The biggest problem with the Rust ecosystem is that everyone keeps using Fira Sans instead of a font that looks good