Click here to Skip to main content
14,428,333 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: Ccc - you win! Pin
Sander Rossel11-Dec-19 3:03
professionalSander Rossel11-Dec-19 3:03 
GeneralRe: Ccc - you win! Pin
musefan9-Dec-19 3:55
Membermusefan9-Dec-19 3:55 
GeneralI never knew I'd miss an operator I hate so much Pin
honey the codewitch8-Dec-19 20:57
mvahoney the codewitch8-Dec-19 20:57 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff8-Dec-19 21:33
communityengineerOriginalGriff8-Dec-19 21:33 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Super Lloyd9-Dec-19 0:30
MemberSuper Lloyd9-Dec-19 0:30 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 0:32
mvahoney the codewitch9-Dec-19 0:32 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 0:56
communityengineerOriginalGriff9-Dec-19 0:56 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
harold aptroot9-Dec-19 1:42
Memberharold aptroot9-Dec-19 1:42 
By the way as for performance, a getter that only returns a field almost always gets inlined (so there is no call, but probably still a load, but loads can get floated up out of loops sometimes so..), for example summing a List<int> while getting the Count property every time is like this: (Core 2.1)
00007FF8646F1807  xor         edx,edx
00007FF8646F1809  mov         r8d,dword ptr [rcx+18h] ; this gets the Count from the List, once.
00007FF8646F180D  test        r8d,r8d
00007FF8646F1810  jle         00007FF8646F1830 ; skip loop if count is zero
; loop goes back here
00007FF8646E1812  cmp         edx,r8d          ; weird redundant loop end check
00007FF8646E1815  jae         00007FF8646E183A
00007FF8646E1817  mov         r9,qword ptr [rcx+8]  ; get array out of list
00007FF8646E181B  cmp         edx,dword ptr [r9+8]  ; get length of array/compare
00007FF8646E181F  jae         00007FF8646E1863      ; do bounds check :(
00007FF8646E1821  movsxd      r10,edx  ; unnecessary because the index is non-negative
00007FF8646E1824  add         eax,dword ptr [r9+r10*4+10h]
00007FF8646E1829  inc         edx
00007FF8646E182B  cmp         edx,r8d
00007FF8646E182E  jl          00007FF8646E1812

Storing the Count before does .. about the same thing, with a slightly different start but not in a way that matters, and different register allocation. So it just doesn't matter, at all.

Other than that there is plenty to critique about Core 2.1's codegen..
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 3:51
mvahoney the codewitch9-Dec-19 3:51 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 9:26
professionalPIEBALDconsult9-Dec-19 9:26 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 10:16
communityengineerOriginalGriff9-Dec-19 10:16 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 10:49
professionalPIEBALDconsult9-Dec-19 10:49 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 22:14
communityengineerOriginalGriff9-Dec-19 22:14 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult10-Dec-19 4:11
professionalPIEBALDconsult10-Dec-19 4:11 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Super Lloyd9-Dec-19 0:29
MemberSuper Lloyd9-Dec-19 0:29 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 0:30
mvahoney the codewitch9-Dec-19 0:30 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Greg Utas9-Dec-19 2:11
professionalGreg Utas9-Dec-19 2:11 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 3:54
mvahoney the codewitch9-Dec-19 3:54 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 9:10
professionalPIEBALDconsult9-Dec-19 9:10 
GeneralYAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 17:29
mvahoney the codewitch8-Dec-19 17:29 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
Chris Maunder8-Dec-19 17:35
cofounderChris Maunder8-Dec-19 17:35 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 18:08
mvahoney the codewitch8-Dec-19 18:08 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
PIEBALDconsult8-Dec-19 18:06
professionalPIEBALDconsult8-Dec-19 18:06 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 18:07
mvahoney the codewitch8-Dec-19 18:07 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
PIEBALDconsult8-Dec-19 19:07
professionalPIEBALDconsult8-Dec-19 19:07 

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.