The issue I'm having is that converting IPublishedContent to a Dto is causing a massive slowdown in code execution and I'm wondering why? Is there a more sensible approach I could use here?
Unless you have hundreds/thousands of properties on your "Job" object, I wouldn't expect that much of a slowdown.
One idea would be that you may have a custom property value converter that is taking a very long time for some reason (e.g., maybe it's hitting the database). I have seen some inefficiencies when working with prevalues (e.g., for properties that are drop downs), as it seems Umbraco sometimes hits the database working working with those. If you have a very slow database connection, that could explain it.
If you want to try some more tests, I'd recommend leaving some properties off of your Job object. Maybe try just mapping a single property, or a subset of properties, and see what the speed differences are.
Converting IPublishedContent to Dtos and performance
Hi guys,
I actually wrote the question and posted it on StackOverflow here: http://stackoverflow.com/questions/43300290/converting-ipublishedcontent-to-dtos-and-performance
The issue I'm having is that converting IPublishedContent to a Dto is causing a massive slowdown in code execution and I'm wondering why? Is there a more sensible approach I could use here?
Thanks
Unless you have hundreds/thousands of properties on your "Job" object, I wouldn't expect that much of a slowdown.
One idea would be that you may have a custom property value converter that is taking a very long time for some reason (e.g., maybe it's hitting the database). I have seen some inefficiencies when working with prevalues (e.g., for properties that are drop downs), as it seems Umbraco sometimes hits the database working working with those. If you have a very slow database connection, that could explain it.
Ah Nicholas, you hit the nail on the head!
I noticed I had a helper method further down that was indeed hitting the DB to query some member data.. which is of course pulled from the DB.
Thanks!
EDIT: Just updated my member query and it's dropped from ~7 seconds to < 1 sec - hooray!
If you want to try some more tests, I'd recommend leaving some properties off of your Job object. Maybe try just mapping a single property, or a subset of properties, and see what the speed differences are.
is working on a reply...