Click here to Skip to main content
15,913,115 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 2:03
professionalSander Rossel11-Dec-19 2:03 
GeneralRe: Ccc - you win! Pin
musefan9-Dec-19 2:55
musefan9-Dec-19 2:55 
GeneralI never knew I'd miss an operator I hate so much Pin
honey the codewitch8-Dec-19 19:57
mvahoney the codewitch8-Dec-19 19:57 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff8-Dec-19 20:33
mveOriginalGriff8-Dec-19 20:33 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Super Lloyd8-Dec-19 23:30
Super Lloyd8-Dec-19 23:30 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch8-Dec-19 23:32
mvahoney the codewitch8-Dec-19 23:32 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff8-Dec-19 23:56
mveOriginalGriff8-Dec-19 23:56 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
harold aptroot9-Dec-19 0:42
harold aptroot9-Dec-19 0: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)
ASM
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 2:51
mvahoney the codewitch9-Dec-19 2:51 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 8:26
mvePIEBALDconsult9-Dec-19 8:26 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 9:16
mveOriginalGriff9-Dec-19 9:16 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 9:49
mvePIEBALDconsult9-Dec-19 9:49 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 21:14
mveOriginalGriff9-Dec-19 21:14 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult10-Dec-19 3:11
mvePIEBALDconsult10-Dec-19 3:11 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Super Lloyd8-Dec-19 23:29
Super Lloyd8-Dec-19 23:29 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch8-Dec-19 23:30
mvahoney the codewitch8-Dec-19 23:30 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Greg Utas9-Dec-19 1:11
professionalGreg Utas9-Dec-19 1:11 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 2:54
mvahoney the codewitch9-Dec-19 2:54 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 8:10
mvePIEBALDconsult9-Dec-19 8:10 
GeneralYAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 16:29
mvahoney the codewitch8-Dec-19 16:29 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
Chris Maunder8-Dec-19 16:35
cofounderChris Maunder8-Dec-19 16:35 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 17:08
mvahoney the codewitch8-Dec-19 17:08 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
PIEBALDconsult8-Dec-19 17:06
mvePIEBALDconsult8-Dec-19 17:06 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 17:07
mvahoney the codewitch8-Dec-19 17:07 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
PIEBALDconsult8-Dec-19 18:07
mvePIEBALDconsult8-Dec-19 18: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.