2 Replies Latest reply on Oct 15, 2018 2:24 PM by Martin Borugadda

    JavaScript API Performance Observations and Suggested Performance Enhancements

    Matthew Ary

      I've been doing some development with the JavaScript API. For the most part it has great coverage of what I need. But there are a few problems that I have Identified. The largest one is performance and how it executes it's requests to the server. I've written my code so that it can operate asynchronously as possible, but the API executes all requests in a synchronous manner. This is very frustrating because this means that the API is only executing one action at a time before it will execute another. I even have proof of this behavior as shown in this screenshot of observed exchanges between the JavaScript API and the server. I want requests to be executed concurrently, but this clearly doesn't do that. Instead, an operation such as this one if it was performed in a non-blocking manner would have multiple API operations performed at the same time.

       

      Below, I'm showing snapshots of the network exchanges between the JavaScript API and a Tableau Server running 10.3. It is applying a filter configuration to a dashboard, making sure that the filters are being applied to each worksheet in the dashboard correctly. To do this I need to identify the data sources, filter names, and other information about the dashboard that has been loaded in. This is what such an operation looks like.

       

      Screen Shot 2018-05-01 at 10.00.58 AM.png

      Screen Shot 2018-05-01 at 10.01.15 AM.png

      This operation typically takes around 70 seconds to complete on Tableau Server 10.3.
      But in Tableau Server 10.5, this operation takes about 50 more seconds to execute. See images below.

       

      Screen Shot 2018-05-01 at 10.07.30 AM.png

      Screen Shot 2018-05-01 at 10.07.42 AM.png

       

      I can't share the workbook or code being used here as its proprietary, but I can share you details about the server configurations.

       

      The 10.3 and 10.5 servers have identical hardware. The most substantial difference is that the 10.3 server is running Windows Server 2008 R2 Standard and the 10.5 server is running Windows Server 2016 Standard.

      To get the data onto the 10.5 server, I created a backup of the data on the 10.3 server and restored it to the 10.5 server. This is important because 10.5 might handle legacy data differently than the 10.3 server as it now has Hyper support.

       

      It's clear that the responses from the 10.5 server are larger than those sent from the 10.3 server. In addition, the speed in which the 10.5 server responds is generally slower. Since the API can't make API requests concurrently, and the requests are blocking, every additional millisecond, not to mention seconds added to each request adds up to a slower experience overall.

       

      Now, if there is a way to make the JavaScript API respond and execute requests in a non-blocking, concurrent manner, Please tell me as I will implement it right away.

       

      I am constantly working on optimizing the algorithm which applies the filters. I'm building systems to cache the results served up from the server so I can reduce the number of API calls I need to make through the JavaScript API. But despite those efforts, the first application of filters to a dashboard is going to be painfully slow.

       

      I don't know what you guys have planned with future changes to the JavaScript API, but it would be great if something can be done about this particular issue.

       

      Thanks!