News for hackers. Stuff that matters.
Re:Rust is now overall faster than C in benchmarks by WalterBright on Sunday January 03, 2021 @09:10PM (#25627266)
D uses slices for strings, which also gives D a big performance boost over C whenever strings are in play.
Re:Rust is now overall faster than C in benchmarks by BruceEel on Monday January 04, 2021 @11:28AM (#25633509)
Walter, can you elaborate on this, are D's slices functionally equivalent to C++'s string_view? I.e. no copying as long no 'ASCIIZ-dependent' code is involved?
Re:Rust is now overall faster than C in benchmarks by WalterBright on Monday January 04, 2021 @09:35PM (#25641354)
D strings are a simply a pointer/length pair. Substrings can be extracted with no alloc/copying necessary. The length can be determined without loading the string into the cache and scanning it.

Those two features make for big speed improvements.