The point of listing these would be to ensure that one doesn't prematurely optimize by avoiding a particular abstraction or language construct, thinking that said construct would cost performance.
Examples could be:
passing non-escaping closures to stdlib functions (e.g. forEach or map) should be just as fast iterating manually
structs that wrap scalar types should be just as fast as the type itself
A non-zero-cost abstraction could be protocols, because passing them to another function incurs additional overhead wrapping the argument in a witness object.
How big is a pointer + info about if it's a some case or none case? Also 8
print(MemoryLayout<UnsafeRawPointer?>.size) // 8
Compiler realizes that the bitpattern of all zeros is unsused in UnsafeRawPointer, so it can be used to represent none case. That way you don't need to add an additional byte to keep track the case of an enum, which would be needed for something that uses up all bits of the size.
You could wonder - Are optional pointers a special case? No! :) It also works with enums other than Optional:
enum Foo {
case something(UnsafeRawPointer)
case nothing
}
print(MemoryLayout<Foo>.size) // 8
and with things that aren't pointers
enum A {
case a
case b
}
enum B {
case c
case d
}
enum C {
case e(A)
case f(B)
}
print(MemoryLayout<A>.size) // 1
print(MemoryLayout<C>.size) // 1