NexusFi: Find Your Edge


Home Menu

 





Profile your code using Visual Studio 2010


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one gomi with 7 posts (23 thanks)
    2. looks_two Taddypole with 3 posts (0 thanks)
    3. looks_3 DrMatt with 2 posts (0 thanks)
    4. looks_4 Big Mike with 2 posts (0 thanks)
      Best Posters
    1. looks_one gomi with 3.3 thanks per post
    2. looks_two merc with 2 thanks per post
    3. looks_3 whitmark with 1 thanks per post
    4. looks_4 bnichols with 1 thanks per post
    1. trending_up 33,354 views
    2. thumb_up 27 thanks given
    3. group 18 followers
    1. forum 21 posts
    2. attach_file 11 attachments




 
Search this Thread

Profile your code using Visual Studio 2010

  #1 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505

Of course you will need a full blown version of VS2010 to use included profiler.
You can also use a demo version of a commercial product, usually they install as add-ons of Visual Studio.

In VS2010, launch Performance Wizard in Analyze menu.

Use standard settings(CPU Sampling), and select NinjaTrader .exe file.

This starts the profiler, which starts Ninjatrader.

Then do you stuff in NinjaTrader, and stop profiling in VS2010 when you're done. Careful, it will kill your NT session.

You get a graph showing CPU usage ; you can select parts of the graph and click "Filter on Selection" to narrow on a specific part.

If you click on "Show Hot Lines" you get a more detailed view of the methods where most CPU was spent. (use "column 3exclusive samples %")

You can also use "Call Tree" to show the most exensive Call Tree

Here's a few charts with an optimization idea example.

Attached Thumbnails
Click image for larger version

Name:	profileinit.png
Views:	2064
Size:	110.3 KB
ID:	13305   Click image for larger version

Name:	profileinitCT.png
Views:	1540
Size:	100.3 KB
ID:	13306   Click image for larger version

Name:	profrendering.png
Views:	1341
Size:	110.5 KB
ID:	13307   Click image for larger version

Name:	profrenderingshshowhot.png
Views:	1259
Size:	84.4 KB
ID:	13309  
Started this thread Reply With Quote
The following 14 users say Thank You to gomi for this post:

Can you help answer these questions
from other members on NexusFi?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
67 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
Battlestations: Show us your trading desks!
43 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,476


Sticky

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505

Update : I was having some performance problems and was willing to be able to get a full symbol profiling.

So tried a few things and here's a solution : when in profile mode, open an indicator, select debug mode an recompile. This will recreate the debugger symbol file the profiler needs.

Then run your time-consuming task and stop profiling ; you'll be able access something like the attached screen : oops, looks like i'm spending 23,6 % of my time doing useless time calculations....

Attached Thumbnails
Click image for larger version

Name:	profiler.png
Views:	826
Size:	91.7 KB
ID:	25938  
Started this thread Reply With Quote
The following 2 users say Thank You to gomi for this post:
  #5 (permalink)
Zchartist
Chicago, IL. USA
 
Posts: 19 since Nov 2010
Thanks Given: 2
Thanks Received: 5

Do you find the new NT version 7 to be more user-friendly ?

Reply With Quote
  #6 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505

As far as debugging is concerned, I had lots of problems with NT 6.5 and VS 2008. Debugger never wanted to attach to process, VS always crashed on NT exceptions etc...
But NT 7 with VS 2010 works perfectly well.

Started this thread Reply With Quote
  #7 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,761 since Jun 2009
Thanks Given: 3,824
Thanks Received: 4,629


gomi View Post
As far as debugging is concerned, I had lots of problems with NT 6.5 and VS 2008. Debugger never wanted to attach to process, VS always crashed on NT exceptions etc...
But NT 7 with VS 2010 works perfectly well.

Don't you have NT7 crashing during debugging session ? I have some crash sometimes; it seems that NT7 don't like to be frozen during more than few minutes.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #8 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505

Well I'm not sure I freeze it during several minutes to do data inspection, till now it has never crashed on me.

Started this thread Reply With Quote
The following user says Thank You to gomi for this post:
  #9 (permalink)
DrMatt
Newcastle NSW Australia
 
Posts: 8 since Aug 2012
Thanks Given: 46
Thanks Received: 3


gomi View Post
Of course you will need a full blown version of VS2010 to use included profiler.
You can also use a demo version of a commercial product, usually they install as add-ons of Visual Studio.

In VS2010, launch Performance Wizard in Analyze menu.

Use standard settings(CPU Sampling), and select NinjaTrader .exe file.

This starts the profiler, which starts Ninjatrader.

Then do you stuff in NinjaTrader, and stop profiling in VS2010 when you're done. Careful, it will kill your NT session.

You get a graph showing CPU usage ; you can select parts of the graph and click "Filter on Selection" to narrow on a specific part.

If you click on "Show Hot Lines" you get a more detailed view of the methods where most CPU was spent. (use "column 3exclusive samples %")









You can also use "Call Tree" to show the most exensive Call Tree

Here's a few charts with an optimization idea example.

I have a free version of VS 2010. I guess this will work?

Reply With Quote
  #10 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505


Pretty sure you don't have any profiler in VS 2010 express, so no, it won't work.

Started this thread Reply With Quote
The following user says Thank You to gomi for this post:





Last Updated on January 13, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts