Click here to Skip to main content
15,848,558 members
Home / Discussions / C#
   

C#

 
Questionsome questions about Chart control Pin
Erdinc2716-Jan-11 3:17
Erdinc2716-Jan-11 3:17 
QuestionStatic label in taskbar Pin
WritinCode15-Jan-11 20:35
WritinCode15-Jan-11 20:35 
AnswerRe: Static label in taskbar Pin
Eddy Vluggen16-Jan-11 11:39
professionalEddy Vluggen16-Jan-11 11:39 
Questioncant play sound from source using MediaElement Pin
igalep13215-Jan-11 13:10
igalep13215-Jan-11 13:10 
AnswerRe: cant play sound from source using MediaElement [modified] Pin
RaviRanjanKr15-Jan-11 19:23
professionalRaviRanjanKr15-Jan-11 19:23 
GeneralRe: cant play sound from source using MediaElement Pin
igalep13216-Jan-11 12:16
igalep13216-Jan-11 12:16 
GeneralRe: cant play sound from source using MediaElement Pin
RaviRanjanKr16-Jan-11 18:57
professionalRaviRanjanKr16-Jan-11 18:57 
QuestionDo people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0115-Jan-11 10:15
SledgeHammer0115-Jan-11 10:15 
Confused | :confused: Confused | :confused: Confused | :confused:

I had to write a function that was essentially "given some random object at RUNTIME as 'object o' and some random property as 'string propertyName' at RUNTIME, return property o.[propertyName] as an object."

First thought was naturally reflection.

for (i = 0; i < 1000000; i++)
{
// get property 1 million times through reflection
}

that took 4.4 seconds on my machine. I unwound the loop a bit and got it down to 2.1 seconds.

Then I switched it over to LINQ expression trees and got it down to 93 MILLSECONDS. 4.4 seconds down to 93 MILLSECONDS...

Now, LINQ expression trees are very poorly documented in MSDN and a search on google and CodeProject turns up very little. It did take me about 5 hours to figure them out (on a super basic level).

But why aren't they used more often? 4.4 seconds vs. 93 millseconds sounds like a big deal to me Smile | :) .
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
Pete O'Hanlon15-Jan-11 11:26
subeditorPete O'Hanlon15-Jan-11 11:26 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0115-Jan-11 12:23
SledgeHammer0115-Jan-11 12:23 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
N a v a n e e t h16-Jan-11 5:51
N a v a n e e t h16-Jan-11 5:51 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
Pete O'Hanlon16-Jan-11 6:06
subeditorPete O'Hanlon16-Jan-11 6:06 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
N a v a n e e t h16-Jan-11 6:15
N a v a n e e t h16-Jan-11 6:15 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
Pete O'Hanlon16-Jan-11 10:12
subeditorPete O'Hanlon16-Jan-11 10:12 
AnswerAll of this post is plagiarised (except for the smiley...) Pin
Keith Barrow15-Jan-11 12:24
professionalKeith Barrow15-Jan-11 12:24 
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
PIEBALDconsult15-Jan-11 15:10
mvePIEBALDconsult15-Jan-11 15:10 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? [modified] Pin
SledgeHammer0115-Jan-11 16:16
SledgeHammer0115-Jan-11 16:16 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0115-Jan-11 16:22
SledgeHammer0115-Jan-11 16:22 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
PIEBALDconsult16-Jan-11 6:11
mvePIEBALDconsult16-Jan-11 6:11 
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
Dan Mos16-Jan-11 4:00
Dan Mos16-Jan-11 4:00 
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
N a v a n e e t h16-Jan-11 6:14
N a v a n e e t h16-Jan-11 6:14 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0116-Jan-11 8:14
SledgeHammer0116-Jan-11 8:14 
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
jschell17-Jan-11 9:22
jschell17-Jan-11 9:22 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? [modified] Pin
SledgeHammer0118-Jan-11 5:55
SledgeHammer0118-Jan-11 5:55 
Questionhow to convert php code into c sharp code Pin
gsmfather15-Jan-11 9:08
gsmfather15-Jan-11 9:08 

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.