The Great Debate
A lot has been said and done about whether to use Early Binding or Late Binding in Dynamics CRM development. Everyone has undoubtedly read James Woods’ blogpost on this matter, and if you haven’t, you should!
This however was written about 3 years ago and I wanted to know if his findings are still valid. Therefore I did some performance tests with the new Dynamics 365 SDK (11/2016).
“Speed is a great asset; but it’s greater when it’s combined with quickness – and there’s a big difference.”
As you know, speed is only half of the equation when it comes to the Early vs Late dilemma. But here I will focus purely on performance.
The following applies:
- Dynamics 365 on premise environment (to rule out online latency)
- 11 runs for each test of which the first will be discarded to have a ‘warm’ run (caching, reflection)
- Creation of 25, 250 and 1000 records with 2 and 6 attributes
- The Early and Late bound tests were ran in different tests to eliminate influence of the generated classes for early binding.
Creation of 1000 records – Early Binding vs Late binding
|#Records||Early 2||Early 6||Late 2||Late 6||Diff. 2 attrib||Diff. 6 attrib|
Beforehand I was convinced that one would surpass the other in speed at a certain amount of records but apparently there is no real correlation between this. But in general the results are not that different. 440 milliseconds on 1000 records is not very much.
Purely based on speed I can’t tell you what to use. I would suggest to set up some tests when you have >1M records to process and then you’ll definitely benefit from your test results.
But then again if you are processing >1M records maybe you should look into other methods than a .NET console application.