News for hackers. Stuff that matters.
Re:We're the core Urbit team, ask us anything about Urbit by crucini on Friday June 17, 2016 @05:29PM (#11925685)
> They are bigint-encoding identifiers? There is no sane reason to do this.

There needn't be any "encoding" really. Modern CPUs have a 32-bit compare instruction. The CPU doesn't understand types as a compiler does; it will accept any aligned series of 4 bytes as a comparand. Some implementations of strcmp use that. Forcing the identifiers to 4 bytes eliminates some if-else edge casing before the compare, which might speed things up.

Disclaimer: I don't know anything about urbit. I agree such an optimization is surprising. The more normal pattern is to convert human-readable symbols to integers early, thus avoiding string comparison in performance-critical sections.

There are no comments on this comment yet.