Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
Questionsome questions about Chart control Pin
Erdinc2716-Jan-11 2:17
Erdinc2716-Jan-11 2:17 
QuestionStatic label in taskbar Pin
WritinCode15-Jan-11 19:35
WritinCode15-Jan-11 19:35 
AnswerRe: Static label in taskbar Pin
Eddy Vluggen16-Jan-11 10:39
professionalEddy Vluggen16-Jan-11 10:39 
Questioncant play sound from source using MediaElement Pin
igalep13215-Jan-11 12:10
igalep13215-Jan-11 12:10 
AnswerRe: cant play sound from source using MediaElement [modified] Pin
RaviRanjanKr15-Jan-11 18:23
professionalRaviRanjanKr15-Jan-11 18:23 
GeneralRe: cant play sound from source using MediaElement Pin
igalep13216-Jan-11 11:16
igalep13216-Jan-11 11:16 
GeneralRe: cant play sound from source using MediaElement Pin
RaviRanjanKr16-Jan-11 17:57
professionalRaviRanjanKr16-Jan-11 17:57 
QuestionDo people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0115-Jan-11 9:15
SledgeHammer0115-Jan-11 9: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? PinPopular
Pete O'Hanlon15-Jan-11 10:26
mvePete O'Hanlon15-Jan-11 10:26 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0115-Jan-11 11:23
SledgeHammer0115-Jan-11 11: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 4:51
N a v a n e e t h16-Jan-11 4:51 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
Pete O'Hanlon16-Jan-11 5:06
mvePete O'Hanlon16-Jan-11 5: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 5:15
N a v a n e e t h16-Jan-11 5:15 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
Pete O'Hanlon16-Jan-11 9:12
mvePete O'Hanlon16-Jan-11 9:12 
AnswerAll of this post is plagiarised (except for the smiley...) Pin
Keith Barrow15-Jan-11 11:24
professionalKeith Barrow15-Jan-11 11:24 
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
PIEBALDconsult15-Jan-11 14:10
mvePIEBALDconsult15-Jan-11 14:10 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? [modified] Pin
SledgeHammer0115-Jan-11 15:16
SledgeHammer0115-Jan-11 15:16 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0115-Jan-11 15:22
SledgeHammer0115-Jan-11 15:22 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
PIEBALDconsult16-Jan-11 5:11
mvePIEBALDconsult16-Jan-11 5:11 
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
Dan Mos16-Jan-11 3:00
Dan Mos16-Jan-11 3: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 5:14
N a v a n e e t h16-Jan-11 5:14 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? Pin
SledgeHammer0116-Jan-11 7:14
SledgeHammer0116-Jan-11 7:14 
AnswerRe: Do people know about LINQ expression trees for super fast reflection? Pin
jschell17-Jan-11 8:22
jschell17-Jan-11 8:22 
GeneralRe: Do people know about LINQ expression trees for super fast reflection? [modified] Pin
SledgeHammer0118-Jan-11 4:55
SledgeHammer0118-Jan-11 4:55 
Questionhow to convert php code into c sharp code Pin
gsmfather15-Jan-11 8:08
gsmfather15-Jan-11 8: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.