Join Nostr
2026-10-19 20:48:36 UTC
in reply to

solo on Nostr: my prof is telling me how doing array out of bounds checks is really expensive and ...

my prof is telling me how doing array out of bounds checks is really expensive

and like.. yeah, it *used* to be, back when C was initially developed (also, C does not store length with the array), but like these days if the array is in L1 and the branch predictor is able to correctly predict the right branch (which it likely will), then it doesn't actually cost *that* much to do the check

also, like, if you're using C++ avoid C arrays and use std::array or whatever else...