Click here to Skip to main content
14,423,065 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralMy very own accidental DoS program Pin
kmoorevs15-Jan-20 11:34
Memberkmoorevs15-Jan-20 11:34 
GeneralRe: My very own accidental DoS program Pin
Ron Anders15-Jan-20 16:46
MemberRon Anders15-Jan-20 16:46 
Generalpurchased code from who knows where Pin
rnbergren10-Jan-20 7:47
Memberrnbergren10-Jan-20 7:47 
GeneralRe: purchased code from who knows where Pin
ZurdoDev10-Jan-20 8:06
mveZurdoDev10-Jan-20 8:06 
GeneralRe: purchased code from who knows where Pin
phil.o10-Jan-20 8:29
mvephil.o10-Jan-20 8:29 
GeneralRe: purchased code from who knows where Pin
RickZeeland10-Jan-20 8:30
communityengineerRickZeeland10-Jan-20 8:30 
GeneralRe: purchased code from who knows where Pin
Eddy Vluggen15-Jan-20 13:01
mveEddy Vluggen15-Jan-20 13:01 
GeneralCross-Platform: dotnet core web api QR Codes Pin
raddevus30-Dec-19 11:00
communityengineerraddevus30-Dec-19 11:00 
PraiseRe: Cross-Platform: dotnet core web api QR Codes Pin
RickZeeland30-Dec-19 11:23
communityengineerRickZeeland30-Dec-19 11:23 
GeneralRe: Cross-Platform: dotnet core web api QR Codes Pin
Brisingr Aerowing10-Jan-20 11:34
professionalBrisingr Aerowing10-Jan-20 11:34 
GeneralRe: Cross-Platform: dotnet core web api QR Codes Pin
raddevus10-Jan-20 12:04
communityengineerraddevus10-Jan-20 12:04 
GeneralHead, meet desk Pin
Richard Deeming20-Dec-19 4:25
communityengineerRichard Deeming20-Dec-19 4:25 
GeneralRe: Head, meet desk Pin
Greg Utas20-Dec-19 5:47
professionalGreg Utas20-Dec-19 5:47 
GeneralRe: Head, meet desk Pin
ZurdoDev20-Dec-19 9:29
mveZurdoDev20-Dec-19 9:29 
GeneralWeird Performance PinPopular
Rick York18-Dec-19 11:11
mveRick York18-Dec-19 11:11 
I am seeing an odd performance pattern that does entirely make sense to me. I am not asking for anything to be solved - just a confirmation of my observations, or not.

First, the background : I have tried a few options for a tracing library. Among them were Paul DiLascia's old TraceWin app and library. That worked pretty well and was the last one I used. It had a few drawbacks and the main was performance. I found it took on order of 6mS per message and that is just to slow for me and my app(s). I finally decided to write my own and it is looking really good. I now have overhead of about 3μS per message - yes, microseconds. This is where the weird part comes in.

That is the performance on my main development machine. It is a i9-9900X at 3.5Ghz and it runs W10. My testing machine is a Xeon i7-3820 at 3.6GHz and it runs W7, thank the heavens. The weird part is the Xeon has an overhead of less than 1μS per message, typically right at 0.9 and these numbers are quite repeatable.

My goal was to make this as low-overhead as possible and I think I have succeeded. Each message puts the message's text into a buffer (with sprintf) and then copies the buffer into a piece of shared memory using memcpy. However, first it acquires a mutex that guards access to the shared memory. I would not expect an i7 Xeon to be faster than an i9 Core-series processor at essentially the same clock rate at much of anything and certainly not three times faster. This leads to my main question : has anyone else seen this kind of performance difference accessing kernel-level OS objects between W7 and W10?

As I am writing this, I just thought of a possible explanation : clock throttling. I bet the i9 has its clock throttled back during this test. I will experiment a little and see if that's it.

-edit-

Upon further review, I think that is the explanation. In the task manager it shows the CPU idling at 1.2GHz and this would explain the performance difference. The test doesn't last long enough for the turbo mode to kick in so the CPU stays at its idle clock rate. Oh well.

I guess this means the trace library has a sub 1μ overhead and I am even happier about that. Yee haw.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"


modified 18-Dec-19 16:21pm.

GeneralRe: Weird Performance Pin
Nelek19-Dec-19 1:27
protectorNelek19-Dec-19 1:27 
GeneralRe: Weird Performance Pin
Rick York19-Dec-19 5:51
mveRick York19-Dec-19 5:51 
GeneralRe: Weird Performance Pin
Nelek19-Dec-19 9:38
protectorNelek19-Dec-19 9:38 
GeneralRe: Weird Performance Pin
Rick York20-Dec-19 9:13
mveRick York20-Dec-19 9:13 
GeneralRe: Weird Performance Pin
Nelek20-Dec-19 9:44
protectorNelek20-Dec-19 9:44 
GeneralHow many values between 0 and 0? Pin
raddevus16-Dec-19 6:59
communityengineerraddevus16-Dec-19 6:59 
GeneralRe: How many values between 0 and 0? Pin
Richard Deeming16-Dec-19 9:49
communityengineerRichard Deeming16-Dec-19 9:49 
GeneralRe: How many values between 0 and 0? Pin
raddevus16-Dec-19 9:58
communityengineerraddevus16-Dec-19 9:58 
GeneralRe: How many values between 0 and 0? Pin
TheGreatAndPowerfulOz16-Dec-19 10:05
MemberTheGreatAndPowerfulOz16-Dec-19 10:05 
GeneralRe: How many values between 0 and 0? Pin
raddevus16-Dec-19 10:21
communityengineerraddevus16-Dec-19 10:21 

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.