Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • awm 187 posts 376 karma points
    Apr 08, 2017 @ 21:00
    awm
    0

    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

  • Nicholas Westby 2054 posts 7104 karma points c-trib
    Apr 09, 2017 @ 05:26
    Nicholas Westby
    101

    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.

  • awm 187 posts 376 karma points
    Apr 09, 2017 @ 06:51
    awm
    0

    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!

  • Nicholas Westby 2054 posts 7104 karma points c-trib
    Apr 09, 2017 @ 05:32
    Nicholas Westby
    2

    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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies