r/programming • • Oct 30 '26

Experimenting with Bindless Textures in WebGPU

https://toji.dev/2026/10/06/webgpu-bindless.html
32 Upvotes

10 comments sorted by

View all comments

Show parent comment

6

u/Somepotato Oct 30 '26

The API doesn't give a fuck about creating garbage for the GC. Bind groups take in JS objects, tons of APIs take in strings instead of enums.

you have some legitimate points but I'd like to call this one out. Strings are interned and this can be more efficient than enums in the JS/TS world.

-3

u/Rhed0x Oct 30 '26

How the hell can comparing a string be faster than a single 32 bit integer?

7

u/Somepotato Oct 30 '26

the complaint was about GC, not speed. And that 32bit integer could come from anywhere, and that anywhere cant always be optimized out. but because theyre interned and are enums in webidl, they are still essentially treated as 32bit integer comparisons behind the scenes.