Click here to Skip to main content
14,737,620 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: CAOTD or.. CATD? Pin
OriginalGriff2-Jun-19 1:34
mveOriginalGriff2-Jun-19 1:34 
GeneralRe: CAOTD or.. CATD? Pin
Mike Hankey2-Jun-19 2:34
professionalMike Hankey2-Jun-19 2:34 
GeneralSkottelbraai Pin
RickZeeland1-Jun-19 21:16
mveRickZeeland1-Jun-19 21:16 
GeneralRe: Skottelbraai Pin
OriginalGriff1-Jun-19 21:41
mveOriginalGriff1-Jun-19 21:41 
GeneralRe: Skottelbraai Pin
RickZeeland1-Jun-19 21:49
mveRickZeeland1-Jun-19 21:49 
GeneralRe: Skottelbraai Pin
Mark_Wallace1-Jun-19 21:48
MemberMark_Wallace1-Jun-19 21:48 
GeneralRe: Skottelbraai Pin
RickZeeland1-Jun-19 21:51
mveRickZeeland1-Jun-19 21:51 
GeneralHigh performance c# PinPopular
Rob Philpott31-May-19 23:50
MemberRob Philpott31-May-19 23:50 
There seems to be a general view that if you want to do some serious compute bound work C++ will always win over C# because of its unmanagedness. This may be the case, but then there's an alternative argument that goes if you sidestep garbage collection, and use unsafe constructs you get close, and because your code gets JITed, there may be a chance to hone the code for the actual CPU it will run on which could actually make .NET faster over a generalised native binary. There seems to be better scope for this if you use the SIMD enabled System.Numerics.

I've been mucking around with sound synthesis in .NET recently, and by using unmanaged memory (Marshal.AllocHGlobal) and unsafe pointers the performance is good enough. In fact I've got it so there are virtually no garbage collections at all (beware of Linq - it creates enumerators all over the place). GCs are terrible news for audio, because a delay can mean a buffer not being ready in time and you get nasty clicks. It means a different approach to coding, but it's still miles preferable to header files and linking libs and all that 32/64 bit nastiness you get with C++.

Then I stumbled on this:

https://www.bepuentertainment.com/

This is a stunning masterclass in what C# can do. I recommend having a look at the video, and reading the bits about GPU vs. CPU and 'a different kind of c#' entries. I'm fairly hard to impress these days, but I've downloaded the code built it and played with it and just... wow.

Moreover, I'd argue its the last nail in the coffin of the argument that C# is not a viable choice for high performance compute bound work.
Regards,
Rob Philpott.

GeneralRe: High performance c# Pin
OriginalGriff1-Jun-19 0:02
mveOriginalGriff1-Jun-19 0:02 
GeneralRe: High performance c# Pin
Munchies_Matt1-Jun-19 0:10
MemberMunchies_Matt1-Jun-19 0:10 
GeneralRe: High performance c# Pin
OriginalGriff1-Jun-19 0:24
mveOriginalGriff1-Jun-19 0:24 
GeneralRe: High performance c# Pin
Rob Philpott1-Jun-19 0:32
MemberRob Philpott1-Jun-19 0:32 
GeneralRe: High performance c# Pin
Munchies_Matt1-Jun-19 0:50
MemberMunchies_Matt1-Jun-19 0:50 
GeneralRe: High performance c# Pin
OriginalGriff1-Jun-19 1:00
mveOriginalGriff1-Jun-19 1:00 
GeneralRe: High performance c# Pin
jschell2-Jun-19 10:55
Memberjschell2-Jun-19 10:55 
GeneralRe: High performance c# Pin
Kirk 103898213-Jun-19 16:25
MemberKirk 103898213-Jun-19 16:25 
GeneralRe: High performance c# Pin
Rob Philpott1-Jun-19 0:27
MemberRob Philpott1-Jun-19 0:27 
GeneralRe: High performance c# Pin
Gerardo Orozco3-Jun-19 5:37
MemberGerardo Orozco3-Jun-19 5:37 
GeneralRe: High performance c# Pin
lopatir1-Jun-19 5:33
Memberlopatir1-Jun-19 5:33 
GeneralRe: High performance c# Pin
jschell2-Jun-19 10:58
Memberjschell2-Jun-19 10:58 
GeneralRe: High performance c# Pin
dandy721-Jun-19 6:03
Memberdandy721-Jun-19 6:03 
GeneralRe: High performance c# Pin
Munchies_Matt1-Jun-19 0:09
MemberMunchies_Matt1-Jun-19 0:09 
GeneralRe: High performance c# Pin
Rob Philpott1-Jun-19 0:17
MemberRob Philpott1-Jun-19 0:17 
GeneralRe: High performance c# Pin
Munchies_Matt1-Jun-19 0:46
MemberMunchies_Matt1-Jun-19 0:46 
GeneralRe: Totally unrelated to C# but... Pin
Member 143310761-Jun-19 3:39
MemberMember 143310761-Jun-19 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.