ABI
struct TriviallyCopyable {
int x; int y;
};
__attribute__((noinline))
TriviallyCopyable Make(int a, int b) {
return {a + 1, b + 2};
}
^ This is Faster?
struct NonTriviallyCopyable {
int x; int y;
~NonTriviallyCopyable() {}
};
__attribute__((noinline))
NonTriviallyCopyable Make(int a, int b) {
return {a + 1, b + 2};
}
^ This is Faster?
* The benchmark is run under AMD Ryzen 9.
* For the full benchmark code, please refer here.
* For illustration purposes only, see FAQ for more details.