Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
QuestionHow to capture image from winForm application in c# Pin
jalbaji4-Sep-14 23:48
professionaljalbaji4-Sep-14 23:48 
AnswerRe: How to capture image from winForm application in c# Pin
OriginalGriff5-Sep-14 0:20
mveOriginalGriff5-Sep-14 0:20 
GeneralRe: How to capture image from winForm application in c# Pin
sankarsan parida5-Sep-14 20:57
professionalsankarsan parida5-Sep-14 20:57 
AnswerRe: How to capture image from winForm application in c# Pin
Pankaj Bhandari085-Sep-14 1:49
Pankaj Bhandari085-Sep-14 1:49 
QuestionRe: How to capture image from winForm application in c# Pin
Ravi Bhavnani5-Sep-14 3:57
professionalRavi Bhavnani5-Sep-14 3:57 
QuestionHow to connect two systems using C# without using any third server ? Pin
AshiSh RaNa4-Sep-14 3:16
AshiSh RaNa4-Sep-14 3:16 
AnswerRe: How to connect two systems using C# without using any third server ? Pin
Pete O'Hanlon4-Sep-14 3:25
mvePete O'Hanlon4-Sep-14 3:25 
GeneralRe: How to connect two systems using C# without using any third server ? Pin
AshiSh RaNa5-Sep-14 3:34
AshiSh RaNa5-Sep-14 3:34 
GeneralRe: How to connect two systems using C# without using any third server ? Pin
jschell5-Sep-14 10:15
jschell5-Sep-14 10:15 
AnswerRe: How to connect two systems using C# without using any third server ? Pin
Bernhard Hiller4-Sep-14 20:55
Bernhard Hiller4-Sep-14 20:55 
GeneralRe: How to connect two systems using C# without using any third server ? Pin
AshiSh RaNa5-Sep-14 3:38
AshiSh RaNa5-Sep-14 3:38 
GeneralRe: How to connect two systems using C# without using any third server ? Pin
Nathan Minier5-Sep-14 3:43
professionalNathan Minier5-Sep-14 3:43 
Question'System.Windows.Controls.Image' does not contain a definition for 'FromFile' Pin
jasonalien4-Sep-14 2:04
jasonalien4-Sep-14 2:04 
AnswerRe: 'System.Windows.Controls.Image' does not contain a definition for 'FromFile' Pin
Richard Deeming4-Sep-14 2:31
mveRichard Deeming4-Sep-14 2:31 
AnswerRe: 'System.Windows.Controls.Image' does not contain a definition for 'FromFile' Pin
Deflinek4-Sep-14 2:44
Deflinek4-Sep-14 2:44 
GeneralRe: 'System.Windows.Controls.Image' does not contain a definition for 'FromFile' Pin
jasonalien4-Sep-14 2:47
jasonalien4-Sep-14 2:47 
GeneralRe: 'System.Windows.Controls.Image' does not contain a definition for 'FromFile' Pin
Deflinek4-Sep-14 2:54
Deflinek4-Sep-14 2:54 
AnswerRe: 'System.Windows.Controls.Image' does not contain a definition for 'FromFile' Pin
Swinkaran4-Sep-14 19:58
professionalSwinkaran4-Sep-14 19:58 
Questionhow to transfer the values of textboxes from one form to another form in datagridviw control without using database Pin
Member 110574883-Sep-14 18:56
Member 110574883-Sep-14 18:56 
AnswerRe: how to transfer the values of textboxes from one form to another form in datagridviw control without using database Pin
Ganesh KP3-Sep-14 19:19
professionalGanesh KP3-Sep-14 19:19 
AnswerRe: how to transfer the values of textboxes from one form to another form in datagridviw control without using database Pin
Pankaj Bhandari085-Sep-14 1:52
Pankaj Bhandari085-Sep-14 1:52 
QuestionNeed help with Expression Trees... Pin
SledgeHammer013-Sep-14 18:44
SledgeHammer013-Sep-14 18:44 
QuestionRe: Need help with Expression Trees... Pin
Richard Deeming4-Sep-14 1:23
mveRichard Deeming4-Sep-14 1:23 
AnswerRe: Need help with Expression Trees... Pin
SledgeHammer014-Sep-14 4:58
SledgeHammer014-Sep-14 4:58 
AnswerRe: Need help with Expression Trees... Pin
SledgeHammer014-Sep-14 8:30
SledgeHammer014-Sep-14 8:30 
Seems like it might have something to do with the parameters. Right now the constructor for the test class is:

public Test(string str, int i, Color color)
{
}

and new'ing up 1M takes 475ms with my current code. By doing NOTHING but changing the constructor to just:

public Test(/*string str, int i, Color color*/)
{
}

it drops to 200ms. So I tried adding 1 param back and it jumps to 312ms. 2 params = 390ms.

So... every additional param is adding quite a bit of time Confused | :confused: Confused | :confused: .

Now, adding back the first param was +112ms, but the 2nd one was only an additional +78ms. I would expect adding back the first param would be expensive since it would now travel down the param code path where without params it skips all that. However, I expected adding the 2nd param would be much cheaper since its just adding another iteration to the param loop.

A standard new up with all 3 params for 1M iterations takes only 31ms.

I'm estimating that there is about 140ms of overhead built into my dynamic new up code, I'm just not getting why adding params is so expensive. So I tried one more test...

for (int i = 0; i < 1000000; i++)
{
int j = 5;
string s = "hello";
Color cr = Color.Red;

// 0ms
//int k = j;

// 15ms
//object k1 = j;

// 0ms
//object k2 = s;

// 46ms!!
object k3 = cr;
}

Seems like the boxing & type casting of the int and color is killing the performance. Boxing a string seems to be pretty cheap. The int and color are structs though...

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.