4 ms·
I’m going to disagree with you that idiomatic C# is somehow unnecessarily “slow”. The performance overhead of a virtual vs non-virtual call on the CLR is negli
by DaiPlusPlus 6y ago
I’m going to disagree with you that idiomatic C# is somehow unnecessarily “slow”.
The performance overhead of a virtual vs non-virtual call on the CLR is negligible - same as with C++. For proof, look at Direct3D which is performance-critical, yet Direct3D’s API is based on COM which is all about vtable-calls.
Linq itself is also very decent. I won’t argue that Linq is perfect (e.g. suboptimal list allocations when the total output length can be known in-advance), but its hardly “slow” - certainly not enough to impact any production workloads - you’d only observe a difference between hand-written loops and a Linq expression in a contrived synthetic benchmark.
- jfkebwjsbx 6y ago> Direct3D’s API is based on COM which is all about vtable-calls. It isn’t. It looks like COM, but it isn’t.
- DaiPlusPlus 6y agoDid things change with DX12? Just asking because this article is quite clear about how DirectX is all about COM: https://docs.microsoft.com/en-us/windows/win32/prog-dx-with-com https://docs.microsoft.com/en-us/windows/win32/prog-dx-with-... > The Microsoft Component Object Model (COM) is an object-oriented programming model used by several technologies, including the bulk of the DirectX API surface. For that reason, you (as a DirectX developer) inevitably use COM when you program DirectX.
- jfkebwjsbx 6y agoDirectX yes, Direct3D no. I am not sure about D3D9, but 10 and 11 and 12 are not COM.