简体   繁体   English

typedef(别名)与结构性能?

[英]typedef (alias) vs struct performance?

Firstly, there are questions about typedef structs vs structs but this is about aliasing, so hopefully it's not a duplicate.首先,有关于 typedef structs 与 structs 的问题,但这是关于别名的,所以希望它不是重复的。

I'm trying to optimize things using SSE2, 4.1, AVX, etc. Is there any difference between this:我正在尝试使用 SSE2、4.1、AVX 等优化事物。这之间有什么区别:

typedef _m512 Single

and:和:

struct Single
{
public:
    Single& operator=(const _m512& InValue);
    operator _m512() const { return Value; }

private:
    _m512 Value;
};

Performance wise?性能明智?

No, there is no difference in runtime performance between these two compile-time constructs.不,这两个编译时构造之间的运行时性能没有区别。

They both take zero nanoseconds.它们都需要零纳秒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM