Click here to Skip to main content
15,889,335 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.

 
AnswerRe: The Missing and Only Valid Reply Pin
W Balboos, GHB2-Jun-20 3:10
W Balboos, GHB2-Jun-20 3:10 
GeneralRe: The Missing and Only Valid Reply Pin
Eddy Vluggen2-Jun-20 5:04
professionalEddy Vluggen2-Jun-20 5:04 
GeneralRe: The Missing and Only Valid Reply Pin
Nelek2-Jun-20 9:25
protectorNelek2-Jun-20 9:25 
GeneralRe: The Missing and Only Valid Reply Pin
W Balboos, GHB2-Jun-20 9:26
W Balboos, GHB2-Jun-20 9:26 
GeneralRe: The Missing and Only Valid Reply Pin
kalberts2-Jun-20 11:35
kalberts2-Jun-20 11:35 
GeneralRe: The Missing and Only Valid Reply Pin
Nelek2-Jun-20 19:35
protectorNelek2-Jun-20 19:35 
GeneralRe: The Missing and Only Valid Reply Pin
Jörgen Andersson2-Jun-20 20:02
professionalJörgen Andersson2-Jun-20 20:02 
GeneralState machine performance woes in .NET Pin
honey the codewitch2-Jun-20 1:22
mvahoney the codewitch2-Jun-20 1:22 
For some reason, there appears to be no wickedly efficient mechanism to "switch/case" in IL. Whereas in C for example your switches can form little jmp offset tables .NET compilers do not produce code like this (not even sure if it's possible or at least efficient in IL, I'd have to look)

In fact, the C# compiler will take long switches and turn them into hashtable lookups instead of jmp tables.

What this means in the real world is that generating compiled code to do something like lexing or parsing is slower than generating table driven code in the first place.

For example, a state machine can be rendered as a bunch of labeled code sections that goto/jmp around to each other, and that's how you'd typically compile it, but in .NET this creates significantly *slower* code in practice than generating an array/table driven state machine which doesn't goto/jmp around, but rather performs actions based on array lookups

This is really annoying to me, because I feel like there's a faster option involving generating actual jmp tables for switch cases but either the CIL can't efficiently provide it or the .NET compilers won't produce the code for it. This limits the effective performance I can get out of state machine code.
Real programmers use butterflies

GeneralRe: State machine performance woes in .NET Pin
BillWoodruff2-Jun-20 2:16
professionalBillWoodruff2-Jun-20 2:16 
GeneralRe: State machine performance woes in .NET Pin
kalberts2-Jun-20 2:30
kalberts2-Jun-20 2:30 
GeneralRe: State machine performance woes in .NET Pin
BillWoodruff2-Jun-20 2:36
professionalBillWoodruff2-Jun-20 2:36 
GeneralRe: State machine performance woes in .NET Pin
F-ES Sitecore2-Jun-20 2:19
professionalF-ES Sitecore2-Jun-20 2:19 
GeneralRe: State machine performance woes in .NET Pin
BillWoodruff2-Jun-20 2:37
professionalBillWoodruff2-Jun-20 2:37 
GeneralRe: State machine performance woes in .NET Pin
F-ES Sitecore2-Jun-20 3:33
professionalF-ES Sitecore2-Jun-20 3:33 
GeneralRe: State machine performance woes in .NET Pin
BillWoodruff2-Jun-20 5:31
professionalBillWoodruff2-Jun-20 5:31 
GeneralRe: State machine performance woes in .NET Pin
kalberts2-Jun-20 8:34
kalberts2-Jun-20 8:34 
GeneralRe: State machine performance woes in .NET Pin
jsc422-Jun-20 10:07
professionaljsc422-Jun-20 10:07 
GeneralRe: State machine performance woes in .NET Pin
kalberts2-Jun-20 3:43
kalberts2-Jun-20 3:43 
GeneralRe: State machine performance woes in .NET Pin
honey the codewitch2-Jun-20 5:00
mvahoney the codewitch2-Jun-20 5:00 
GeneralRe: State machine performance woes in .NET Pin
BillWoodruff2-Jun-20 5:29
professionalBillWoodruff2-Jun-20 5:29 
GeneralRe: State machine performance woes in .NET Pin
honey the codewitch2-Jun-20 6:38
mvahoney the codewitch2-Jun-20 6:38 
GeneralRe: State machine performance woes in .NET Pin
BillWoodruff2-Jun-20 8:06
professionalBillWoodruff2-Jun-20 8:06 
GeneralRe: State machine performance woes in .NET Pin
honey the codewitch2-Jun-20 9:39
mvahoney the codewitch2-Jun-20 9:39 
GeneralRe: State machine performance woes in .NET Pin
Super Lloyd2-Jun-20 2:24
Super Lloyd2-Jun-20 2:24 
GeneralRe: State machine performance woes in .NET Pin
obermd2-Jun-20 3:34
obermd2-Jun-20 3:34 

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.