Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 5,969 | Comments: 44,490

filter by tags archive

Profiler new features: Data binding alerts


The following features apply to NHProf, EFProf, L2SProf.

In general, it is strong discouraged to data bind directly to an IQueryable. Mostly, that is because data binding may actually iterate over the IQueryable several times, resulting in multiple queries being generated from something that can be done purely in memory. Worse, it is actually pretty common for data binding to result in lazy loading, and lazy loading from data binding almost always result in SELECT N+1. The profiler can now detect and warn you about such mistakes preemptively. More than that, the profiler can also now detect queries that are being generated from the views in an ASP.Net MVC application, another bad practice that I don’t like.

You can find more information about each warnings here:

WPF detection:

image

 

image

WinForms detections:

image

image

Web applications:

image

image


Comments

tobi

A nice step to counteract the counterproductive trend in the .NET world to rely on such practices for dubious code savings.

configurator

So that's why you needed to look at the stack trace!

José F. Romaniello

Can you detect if a lazy property was initialized because a databinding?

that will be really useful.

thanks

Ayende Rahien

Jose,

Yes, that will detect this as well

Nigel Sampson

Very cool, I ended up handling this by disposing of my unit of work at the end of the action (through an ActionFilter) which means that any lazy evaluation in the view throws an exception.

Cheers

anon

efprof-735 throws bad image format exception on my xp machine.

Ayende Rahien

Anon,

Yes, there was an issue with uploading to the server.

Build 738 fixes the issue

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. Production postmortem (5):
    29 Jul 2015 - The evil licensing code
  2. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
  3. API Design (7):
    20 Jul 2015 - We’ll let the users sort it out
  4. What is new in RavenDB 3.5 (3):
    15 Jul 2015 - Exploring data in the dark
  5. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
View all series

RECENT COMMENTS

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats