Skip to main content

Trend high CPU ussage

Problem: When few trends were opened in an application, no performance issue were noticed. But if ten or more trends would be opened each trend having around seven traces in average, the application would hang.

Analysis: On analysis it was noticed that the CPU load would be high leading to the application hang.
  • On digging further, the trend drawing event would consume most of the CPU. Hence the drawing of the traces was reviewed. It was noticed that once the traces reach till the end of X axis, its logic had  some flaw where for each trend traces were being drawn again instead of removing or hiding the old points and joining the end points incrementally.
  • The above fix would solve half of the problem. Then it was further optimized by suspending the paint events of the trends that were not in view for some time. The drawing event will resume once the trend display is viewed again.
Solution: The performance of the trend was improved by implementing incremental joining of trend points where the trace was being reused instead of drawing it again. And it could be further optimized by tracking the visibility and usage of the trends.

Comments

Popular posts from this blog

Real time data to web application using Microsoft Signal R and Razor Pages

Today we are going to learn how to create razor pages and how to send run time value to the razor page using Signal R Create a new .NET core web application Add Signal R library by,  Add Client-Side Library dialog in the project, for Provider select "unpkg" and select the latest version from the drop down For Library, enter @aspnet/signalr@1, Add a new folder to the project named as Hubs The chat hub class inherits from HUb class that manages connections and messaging The send message is called to send the message to all the clients. MyHub.cs file contains the following code using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.SignalR; //using System.Threading.Tasks; namespace SignalRSample.Hubs {     public class MyHub : Hub     {         public async Task SendMessage(string user, string message)         {       ...

Online Exam App with .NET Core Web API and Blazor Client

 We will develop an app that can host online exam. It will have the feature to register user, allow the user to log in. Dashboard for creating sample tests.  The code is shared in GIT hub repository https://github.com/ SwagatikaGoswami/ OnlineExamApp.git The database is MySQL database. The server is a WEB API .NET Core service that uses entity framework for DB operations. The client is a web assembly blazor application. The password stored in the database is encrypted. Register window is as follows. It checks for the mandatory fields. The log in page is as follows: The admin dashboard after logging in  The admin dashboard when new test button is clicked. It uses a Blazor component for adding new test samples.

SQL Lite CRUD operation using Visual Studio Web Application

Problem: How do I perform CRUD operation in web? Solution: I will explain in detail steps how to write a simple web application that is capable of crud operation in SQL server.  From Visual Studio create a MVC web application. I used Visual Studio 2017. Add entity framework core, sql server compact packages from NuGet browser if you want Get a SQL lite database (mdf file) and add an employee table with columns, Id (int), name, address and phone number as varchar. Copy it to the data folder in the application folder Add a class named employee to the modal class with properties same as the column names in the employee table Add a controller class named employees Go to the appsettings.json file,  rename your copied database file to the same name as the database name in the connection string Go to the layout page and add the newly created employees CRUD operation index page to the web layout Build the project  Launch the website by pressing F5 Check if you a...