I have a WebAPI2/OData Breeze server (.NET 4.5, EntityFramework 6) that I'm querying from a Breeze/AngularJS client. I expected running a full entity query to be slower than running a projection, but I expected it to be somewhat proportional to the amount of data crossing the wire. But if I run a projection like:
var query = breeze.EntityQuery.from('Users')
.where('firstName', 'startsWith', 'K')
.select('firstName');
return manager
.executeQuery(query)
.then(querySucceeded, _queryFailed);
I get 45KB of data, and the request takes 15ms. (Release mode)
And I run a full entity query like:
var query = breeze.EntityQuery.from('Users')
.where('firstName', 'startsWith', 'K');
return manager
.executeQuery(query)
.then(querySucceeded, _queryFailed);
I get 159KB of data, and the request takes 154ms. (Release mode)
That makes the entity query return about 3x the data, but it takes 10x longer. The discrepancy is even more apparent if I run in Debug mode. Then the projection takes 39ms, but the full entity query takes a full 8120ms(!), which makes debugging a bit of a pain. So in Debug mode the full entity query actually takes over 200x longer than the projection.
Why would a full entity query take disproportionately longer, and in Debug mode in particular? Is this normal, or is this indicative of some issue?