Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Been performance testing....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Been performance testing....

    Hello,

    I've been doing some performance testing. Specifically, measuring the time it takes for an entire chart to be rendered. How I measured this is to start a stopwatch, call InvalidateVisual and measure the elapsed time. This would be a time for the entire chart and all indicators? I can then add or remove an indicator or plot and see the total render time change. All good (presumably). It seems to work. So, I found one of my indicators that has a couple of plots that would add around 10ms to render time. I have however already carefully profiled this indicator and the whole of OnRender and OnRenderTargetChanged takes less than 2ms, always. If I measure this by simply unticking 'Visible' in the indicator properties, my overall chart render time drops again by about 10 ms. So, my question is, what else runs and could be accounting for the additional render time? Because it seems that the overhead of OnRender&OnRenderTargetChanged does not reflect the additional time that this indicator consumes after an InvalidateVisual call.

    Thanks.

    #2
    Originally posted by pjsmith View Post
    I've been doing some performance testing. Specifically, measuring the time it takes for an entire chart to be rendered. How I measured this is to start a stopwatch, call InvalidateVisual and measure the elapsed time. This would be a time for the entire chart and all indicators? I can then add or remove an indicator or plot and see the total render time change. All good (presumably). It seems to work. So, I found one of my indicators that has a couple of plots that would add around 10ms to render time. I have however already carefully profiled this indicator and the whole of OnRender and OnRenderTargetChanged takes less than 2ms, always. If I measure this by simply unticking 'Visible' in the indicator properties, my overall chart render time drops again by about 10 ms. So, my question is, what else runs and could be accounting for the additional render time? Because it seems that the overhead of OnRender&OnRenderTargetChanged does not reflect the additional time that this indicator consumes after an InvalidateVisual call.
    Depends on what else that indicator is doing.

    Does it call any other indicators?
    Does it add any additional data series?

    Comment


      #3
      Hi - Does not call any other indicators, but does have a tick series loaded.

      Comment


        #4
        Originally posted by pjsmith View Post
        Hi - Does not call any other indicators, but does have a tick series loaded.
        Well, there's your problem.

        Don't do that.

        Comment


          #5
          Hello pjsmith,

          Calling InvalidateVisual will cause higher rendering times, guaranteed. We support using ForceRefresh() as this renders on the next render pass without increasing the number of passes.


          This would depend on what is in the script, including code that requires high CPU usage and the number of objects being created for rendering. Have you commented out code to find out which line is causing the high usage?

          Below is a link to a forum post on efficient custom rendering by re-using objects.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ageeholdings, 05-01-2024, 05:22 AM
          5 responses
          30 views
          0 likes
          Last Post ageeholdings  
          Started by reynoldsn, Today, 02:34 PM
          0 responses
          6 views
          0 likes
          Last Post reynoldsn  
          Started by nightstalker, Today, 02:05 PM
          0 responses
          10 views
          0 likes
          Last Post nightstalker  
          Started by llanqui, Yesterday, 09:59 AM
          8 responses
          29 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by quicksandatl, Today, 01:39 PM
          1 response
          6 views
          0 likes
          Last Post quicksandatl  
          Working...
          X