Calls taking several seconds / application based on c# example code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr.Anderson
    Junior Member
    • Oct 2010
    • 16

    #1

    Calls taking several seconds / application based on c# example code

    I've just written a test application using the c# example code as a foundation. It works just as I hoped it would except it takes many seconds for all api calls. (The stuff below may not make sense to you if you're not familiar with the c# example code.)

    It takes approximately 1.5 - 2.2 seconds before I get a marketBook back from:

    var marketBook = client.listMarketBook(marketIDs, priceProjection)

    When I ask for data from another bigger market with many more selections, and my own position in that market it takes 11 to 12 seconds before I get my marketBook.

    marketBook = client.listMarketBook(marketIDs, priceProjection, orderProjection, matchProjection)

    Placing 20 bets on that market takes about 1.5 seconds

    placeExecutionReport = client.placeOrders(marketID, customerRef, placeInstructions)

    I've noticed this disclaimer: "Please Note: In order to aide ease of understanding, the basic Betfair samples are not intended to show certain best practices for speed and throughput. Well designed applications should follow the best practices for client design of the application/language platform and should optimise on an HTTP request level with features such as requesting gzip'd responses and http connection keep alives."

    Even so up to 12 seconds seems a bit much. A series of calls that for me take just a bit more than 1 second with API6 take more than 15 seconds with API NG. Anyone with more programming knowledge than myself (probably most people reading this) care to guess why my calls take so long? How would you go about troubleshooting this? Any tips about where I can learn more about "best practices for speed and throughput" would also be appreciated.
  • Mr.Anderson
    Junior Member
    • Oct 2010
    • 16

    #2
    Problem solved.

    Comment

    • betdynamics
      Junior Member
      • Sep 2010
      • 534

      #3
      What was the problem / solution?

      Comment

      • Mr.Anderson
        Junior Member
        • Oct 2010
        • 16

        #4
        Well, it's a bit embarrassing, but the problem was that I ran my program in debug mode. When I published it, and ran it as it should be ran 11-12 seconds immediately became less than half a second. I wasn't aware that debug mode could make that much difference

        Comment

        • doctormike
          Junior Member
          • Nov 2012
          • 55

          #5
          Debug mode

          My migrated app works just as fast in debug mode as with API6, and no discernible difference in speed between debug and published, so you might want to explore the issue a bit further, especially if you have any further significant development to do. Mine is coded in Visual Basic, but I can't see why that should make much difference.
          With regards
          Mike

          Comment

          Working...
          X