News for hackers. Stuff that matters.
Re:Pattern Matching for Java by zamalek on Wednesday April 19, 2017 @06:38PM (#14152431)
What's even better is that the DLR consists of some pretty tight code. Historically I was using a ConcurrentDictionary containing Funcs compiled using Expression. I've found the DLR is just as fast (for things that you can express with it), with a much lower overhead. I've started using it in dynamic scenarios wherever possible.

Basically, this is going to be about as fast as you can get with the statically-typed underlying runtime.

Re:Pattern Matching for Java by zastrowm on Thursday April 20, 2017 @12:04AM (#14153848)
> I've found the DLR is just as fast... with a much lower overhead

Can you expand on this? I would not have expected that it would be faster than compiled expressions.

Re:Pattern Matching for Java by zamalek on Thursday April 20, 2017 @04:52AM (#14155021)
The codegen creates a cache of delegates (created using expression trees), but uses a structure more suited to the problem than a simple ConcurrentDictionary.

[1]: http://geekswithblogs.net/simonc/archive/2012/07/20/inside-t...

Re:Pattern Matching for Java by zastrowm on Thursday April 20, 2017 @02:07PM (#14159208)
Ah, faster than the `ConcurrentDictionary`. That makes sense!
Re:Pattern Matching for Java by duncans on Thursday April 20, 2017 @04:40AM (#14154944)
Dynamic calls gets compiled at runtime, so there's an initial hit (as there would be with Expr.Compile) but after that ...