Click here to Skip to main content
15,891,473 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 0:34
mveOriginalGriff2-Jun-19 0:34 
GeneralRe: CAOTD or.. CATD? Pin
Mike Hankey2-Jun-19 1:34
mveMike Hankey2-Jun-19 1:34 
GeneralSkottelbraai Pin
RickZeeland1-Jun-19 20:16
mveRickZeeland1-Jun-19 20:16 
GeneralRe: Skottelbraai PinPopular
OriginalGriff1-Jun-19 20:41
mveOriginalGriff1-Jun-19 20:41 
GeneralRe: Skottelbraai Pin
RickZeeland1-Jun-19 20:49
mveRickZeeland1-Jun-19 20:49 
GeneralRe: Skottelbraai Pin
Mark_Wallace1-Jun-19 20:48
Mark_Wallace1-Jun-19 20:48 
GeneralRe: Skottelbraai Pin
RickZeeland1-Jun-19 20:51
mveRickZeeland1-Jun-19 20:51 
GeneralHigh performance c# Pin
Rob Philpott31-May-19 22:50
Rob Philpott31-May-19 22: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
OriginalGriff31-May-19 23:02
mveOriginalGriff31-May-19 23:02 
GeneralRe: High performance c# Pin
Munchies_Matt31-May-19 23:10
Munchies_Matt31-May-19 23:10 
GeneralRe: High performance c# Pin
OriginalGriff31-May-19 23:24
mveOriginalGriff31-May-19 23:24 
GeneralRe: High performance c# Pin
Rob Philpott31-May-19 23:32
Rob Philpott31-May-19 23:32 
GeneralRe: High performance c# Pin
Munchies_Matt31-May-19 23:50
Munchies_Matt31-May-19 23:50 
GeneralRe: High performance c# Pin
OriginalGriff1-Jun-19 0:00
mveOriginalGriff1-Jun-19 0:00 
GeneralRe: High performance c# Pin
jschell2-Jun-19 9:55
jschell2-Jun-19 9:55 
GeneralRe: High performance c# Pin
Kirk 103898213-Jun-19 15:25
Kirk 103898213-Jun-19 15:25 
GeneralRe: High performance c# Pin
Rob Philpott31-May-19 23:27
Rob Philpott31-May-19 23:27 
GeneralRe: High performance c# Pin
Gerardo Orozco3-Jun-19 4:37
Gerardo Orozco3-Jun-19 4:37 
GeneralRe: High performance c# Pin
lopatir1-Jun-19 4:33
lopatir1-Jun-19 4:33 
GeneralRe: High performance c# Pin
jschell2-Jun-19 9:58
jschell2-Jun-19 9:58 
GeneralRe: High performance c# Pin
dandy721-Jun-19 5:03
dandy721-Jun-19 5:03 
GeneralRe: High performance c# Pin
Munchies_Matt31-May-19 23:09
Munchies_Matt31-May-19 23:09 
GeneralRe: High performance c# Pin
Rob Philpott31-May-19 23:17
Rob Philpott31-May-19 23:17 
GeneralRe: High performance c# Pin
Munchies_Matt31-May-19 23:46
Munchies_Matt31-May-19 23:46 
GeneralRe: Totally unrelated to C# but... Pin
Member 143310761-Jun-19 2:39
Member 143310761-Jun-19 2: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.