Analyzing performance of Digital Adoption Platform

Gaurav Sankhla
WhatfixEngineeringBlog
6 min readJan 10, 2022

Digital adoption platforms are a huge productivity booster for the employees as well as companies. From in-app guidance to contextual help, DAP eases the process of learning new technology and increase efficiency of its users.

DAP are usually 3rd party products like Whatfix, which are deployed on top of any web, desktop or mobile application. Taking a typical web implementation of DAP, it’s a Javascript overlay on top of a web application. Javascript is injected on any web application with the help of browser extension or adding a script tag into the host application (where application facilitates script injection through it’s source code).

Since DAP is like an added Javascript layer on top of a web application, it runs certain algorithms to detect HTML elements hierarchy and structure of the application to show it’s features/widgets. While running those algorithms, computations time may also increase (which differs from app to app). Due to increase in computation time, sometimes it may alter the performance of the underlying application.

Below are few performance issues which may appear on the host application-

  • Delay/lag in application load
  • Javascript being single threaded if host application and DAP algo are of high computational complexity, it may have performance impact.
  • No memory left error (memory leak)
  • Storage issues (Local Storage / Session Storage over use)
  • Delayed network calls
Image by LukeCheeser at unsplash.com

Detecting performance issues

Performance issues can be due to multiple reasons. Few of primary reasons are:

  • Faulty code in host application or DAP tool
  • Loop(s) (setInterval, etc) continuously running
  • If system is of lower config, it may end up having less memory or CPU
  • Third party browser extension interrupting performance

Here’s the step by step process to correctly identify the root cause. We’ll categorise triage into 5 step process-

1. Checking logs

It’s a good practice to log all critical functionalities of the product. Logs can be categorised under debug, info, performance, error, etc. Example: DAP tool logging on run time in the below image. Logs help to debug faster as well as to generate alerts if they cross a certain threshold. Here are few good practices developers can follow when coding logs -

  • Always log through an internal API which can allow for the possibility to switch ON/OFF actual console logging of different levels.
  • Describe the way to enable/disable logs on individual browser windows based on setting a variable in the console / persisting it in local storage / based on URL pattern.
  • Follow patterns in log messages so that it is easy to filter out in the console window. (Attached in image below)
  • Make a note that too many logs can themselves cause performance issues and be prudent about the usage.

2. Browser profiling

Modern browsers like Chrome and Firefox browsers provide detailed profiling tools which help in analysis. It also provides information about which event/functionality is consuming most of the time or memory. Example screenshot attached below. Profiling data helps in observing patterns of the entire host app with DAP, which is usually not captured in logs. Here are a few links to interpret browser profiling-

3. Comparing application load time with and without DAP

Sometimes performance lag or issues may also occur as the host application consuming most of the memory and CPU or system is of lower configuration. Or issues may occur due to DAP layer consuming/leaking memory. In order to evaluate memory issues due to DAP, implementing layered switches on the DAP functionalities help. Example:

  • Complete switch ON/OFF for the DAP layer
  • Switch for different functional areas of DAP. This will help in narrowing down issues faster.

Switch flags can be enabled or disabled by multiple ways, few of the are:

  • Calling a server API to fetch flag
  • Setting a variable in browser console
  • Calling a function in the browser console to persist information in local/session storage.
  • Special query parameters in the URL, etc.

Few parameters to compare when flag is enabled/disabled — Load, Scripting, rendering, etc timing.

4. Memory profiling

Since DAP tool works as an overlay Javascript layer, it’s execution scope would be the same as that of application. If constructing/destructing objects/variables are not handled properly, it may lead to memory leak. Analysing the memory profile of the browser will give us detailed understanding of memory usage. It can be achieved by taking memory snapshots from the browser.

5. Checking Network calls

Network calls (if not cached) may sometimes take longer than expected time. If the life-cycle (Time to live) of any network call is more than it’s benchmark time (which is set by app itself), it may impact overall application performance as app functionalities may depend on these network calls. Below are network monitoring articles for modern browsers.

Acting upon issues found

Any tool, application or extension creates more impact when they have auto-healing capabilities as the user doesn’t have to wait for the resolution. Say, if any specific feature or algorithm is causing performance issues and logs are added at all critical juncture of the algorithm then enabling/disabling features/algorithms can be part of the auto-heal algorithm. Few of the good practices are-

  • Identifying threshold for each feature and auto-disabling it if performance numbers are crossing the threshold.
  • Sending alerts to the server if any of the algorithms malfunctioned.
  • Keeping all critical or performance heavy algorithms under a feature flag. Turning off a feature flag can be an immediate solution.

Good practices to avoid performance issues

Some good practices can help us avoid performance issues on the application.

  • Logging methods, algorithms, features with different log levels and sending critical logs to the server and generating alerts based on them.
  • Adding new features behind a flag.
  • Detailed NFR testing on low config machines with different OS and browser combinations.
  • Testing DAP tools on heavy enterprise apps. If any DAP tool is consuming more than 10% of overall CPU & Memory of the tab, it needs a performance assessment.

Other factors impacting app performance

  • Browser specific issues — Sometimes few events/Javascript api’s work better in one browser and degrade performance on other.
  • Too many web extensions — Since Javascript is single threaded. Too many web extensions on the tab may degrade app performances as chances of Javascript thread being used by them would be very high.
  • Host application consuming most of the memory — If host application is consuming most of the memory and CPU cycles, then installing DAP on top of host app will lead to perf issues.
  • Firewall layer of application blocking/redirecting network calls which may end up consuming more than expected time.

Conclusion

Digital Adoption Platforms add a huge value to the web applications but they can also lead to performance issues if not properly implemented. Adding a few performance checks on the application and analyzing applications over different computing platforms will help in preventing performance degradation. Whatfix being one of the top DAP companies, have taken all necessary measures to deliver a smooth experience on all the applications it is deployed. Read more about it here.

--

--