Click here to Skip to main content
15,906,333 members
Home / Discussions / C#
   

C#

 
QuestionWhat is the proper Domain Model for this relationship? Pin
Togakangaroo6-Aug-08 15:37
Togakangaroo6-Aug-08 15:37 
AnswerRe: What is the proper Domain Model for this relationship? Pin
Kjetil Svendsen6-Aug-08 22:36
Kjetil Svendsen6-Aug-08 22:36 
GeneralRe: What is the proper Domain Model for this relationship? Pin
Togakangaroo7-Aug-08 2:31
Togakangaroo7-Aug-08 2:31 
Question[Message Deleted] Pin
csharp-job6-Aug-08 14:48
csharp-job6-Aug-08 14:48 
AnswerRe: Any good C# programmers around Norwalk, CT - Full time position Pin
Mogaambo7-Aug-08 0:07
Mogaambo7-Aug-08 0:07 
AnswerRe: Any good C# programmers around Norwalk, CT - Full time position Pin
Thomas Stockwell7-Aug-08 1:33
professionalThomas Stockwell7-Aug-08 1:33 
QuestionCrystal Reports - easy advice needed Pin
nelsonpaixao6-Aug-08 14:30
nelsonpaixao6-Aug-08 14:30 
QuestionInline MSIL in C#? Pin
dybs6-Aug-08 12:40
dybs6-Aug-08 12:40 
From what I've read so far, it's supposedly impossible to inline MSIL in C#, the compiler just doesn't allow it. I thought I'd see what y'all had to say about it anyway...

I have a DLL project in C#, and a couple of one-line functions are a bit of a bottleneck right now. In C#, they look like
int bar()(
return x & 0x7FFFFFFF;
}

bool foo(){
return bar() == 0;
}


Looking at the MSIL, there's a bit of a performance boost I can get back changing the .maxstack value from 8 to 2 for both of these functions. My results of using optimized vs. unoptimized code are similar to the results this guy got:
http://bytes.com/forum/thread227229.html[^]

With .maxstack 8, there are a few extra stack pushes/pops, and registers are zeroed out and then moved, and moved again, and these things really don't seem to accomplish much at all. Changing to .maxstack 2 and reassembling removes these extra instructions, and there's a definite performance boost (maybe 25%). Overall the function is quick, but it gets called so many times that I'd like to improve it's performance any way I can. With the problem I'm working on right now, it's already taking 2 hours to process a common set of data. I'd like to get it down to 1 hour, but I'll settle for 1.5.

I can disassemble the DLL, change the IL, and reassemble it if absolutely necessary, but I'd have to do this anytime to recompile the DLL. I'd like to just inline the MSIL changes I need to make rather than reassemble the DLL every time. Is this even possible?

Thanks,

Dybs
AnswerRe: Inline MSIL in C#? Pin
Guffa6-Aug-08 14:48
Guffa6-Aug-08 14:48 
GeneralRe: Inline MSIL in C#? Pin
dybs6-Aug-08 15:44
dybs6-Aug-08 15:44 
GeneralRe: Inline MSIL in C#? Pin
Mark Churchill6-Aug-08 21:33
Mark Churchill6-Aug-08 21:33 
GeneralRe: Inline MSIL in C#? Pin
leppie7-Aug-08 3:13
leppie7-Aug-08 3:13 
GeneralRe: Inline MSIL in C#? Pin
dybs7-Aug-08 6:53
dybs7-Aug-08 6:53 
QuestionWebApp or WinApp? Pin
k6666-Aug-08 10:42
k6666-Aug-08 10:42 
AnswerRe: WebApp or WinApp? Pin
Ravi Bhavnani6-Aug-08 12:14
professionalRavi Bhavnani6-Aug-08 12:14 
GeneralRe: WebApp or WinApp? Pin
k6667-Aug-08 3:28
k6667-Aug-08 3:28 
AnswerRe: WebApp or WinApp? Pin
Manas Bhardwaj7-Aug-08 5:19
professionalManas Bhardwaj7-Aug-08 5:19 
GeneralRe: WebApp or WinApp? Pin
k6667-Aug-08 6:06
k6667-Aug-08 6:06 
GeneralRe: WebApp or WinApp? Pin
Manas Bhardwaj7-Aug-08 7:43
professionalManas Bhardwaj7-Aug-08 7:43 
GeneralRe: WebApp or WinApp? Pin
k6667-Aug-08 7:49
k6667-Aug-08 7:49 
GeneralRe: WebApp or WinApp? Pin
Manas Bhardwaj7-Aug-08 8:02
professionalManas Bhardwaj7-Aug-08 8:02 
GeneralRe: WebApp or WinApp? Pin
k6667-Aug-08 11:25
k6667-Aug-08 11:25 
QuestionAuto refresh and timeout Pin
CezW6-Aug-08 9:39
CezW6-Aug-08 9:39 
AnswerRe: Auto refresh and timeout Pin
leppie6-Aug-08 10:07
leppie6-Aug-08 10:07 
AnswerRe: Auto refresh and timeout Pin
Guffa6-Aug-08 12:26
Guffa6-Aug-08 12:26 

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.