Virtualization in Data Grids
When an application needs to display thousands of records, traditional data grids quickly hit a wall. Rendering 10,000 rows with 10 columns implies creating 100,000 DOM elements — a recipe for browser crashes and frustrated users.

Enter Virtualization, the technique that transforms sluggish data grids into lightning-fast experiences.
galaxy
4030 (1) (1).png
Virtualization in Data GridsVirtualization in Data Grids

The Problem

Traditional data grids render every single row and column, whether visible or not. This leads to:

  • Memory bloat from unnecessary DOM nodes.
  • Sluggish scrolling due to rendering overhead.
  • Slow initial loads as browsers process massive DOM trees.
  • Potential crashes with extremely large datasets.

The Solution

Virtualization (aka “windowing”) renders only what users can see, plus a small buffer for smooth scrolling. Instead of hundreds of thousands of DOM nodes, only ~20–30 rows stay in memory.

The magic happens through:

  1. Calculating visible viewport
  2. Rendering only visible items + configurable buffer zone
  3. Dynamically creating and destroying elements during scroll
  4. Reusing existing DOM nodes

Building a Virtualized Data Grid

Virtualization can be achieved in React using third-party libraries like:

  • react-window
  • react-virtualized
  • TanStack Virtual

TanStack Virtual is preferred over other libraries, this is because it offers a headless API with maximum flexibility, precision control over virtualized nodes, and performance optimizations for complex and dynamic layouts. This makes it ideal for data-intensive applications. Here is a comprehensive implementation guide for creating a high-performance virtualized data grid using @tanstack/react-virtual package that can handle thousands of rows with enhanced user experience.

1. Setting Up the Foundation

Start with establishing the core structure using the useVirtualizer hook. This hook requires three essential parameters:

  • The total count of rows
  • A reference to the scrollable element
  • Estimated size of each row

Virtualization works by calculating items that should be visible based on the current scroll position.

2. Creating the Container Structure

The virtualized grid requires a three-layer container approach for optimal performance. The outermost container serves as the scroll viewport with a fixed height and overflow properties. The inner container maintains the total calculated height of all items to preserve proper scrollbar behaviour. Individual rows are the absolutely positioned using CSS transforms, which provides superior performance compared to traditional positioning methods.

3. Implementing Row Virtualization

The row virtualizer declared earlier handles vertical scrolling by managing which rows are currently visible. Using the overscan property creates a buffer zone that renders additional rows above and below the visible area, ensuring smooth scrolling without content flashing. The virtualizer automatically calculates the start and end positions for each visible row, allowing for precise positioning within the scroll container.

const rowVirtualizer = useVirtualizer({
    count: rows.length,
    getScrollElement: () => parentRef.current,
    estimateSize: () => 35                     //Standard row height
  });

4. Adding Column Management

For data grids with numerous columns, horizontal virtualization is equally important. We use a separate column virtualizer that works collaboratively with the row virtualizer. This dual-virtualization approach ensures that both dimensions remain performant, especially when dealing with wide tables that extend both horizontally & vertically.

const columnVirtualizer = useVirtualizer({
  horizontal: true,
  count: columns.length,
  getScrollElement: () => parentRef.current,
  estimateSize: () => 150                    //Standard column width
});

5. Handling Dynamic Content

Data grids can contain variable-sized rows due to dynamic content like text wrapping or embedded components. We accommodate this through the measureElement ref callback, which allows the virtualizer to measure actual rendered dimensions and adjust calculations accordingly. This measurement system ensures accurate scrollbar behavior and positioning even with content of varying heights.

const virtualRows = rowVirtualizer?.getVirtualItems();
const virtualColumns = columnVirtualizer?.getVirtualItems();

const gridRows = virtualRows?.map((row) => (
  <div
    key={row?.key}
    style={{
      transform: `translateY(${row?.start}px)`,
      height: row?.size,
      width: '100%'
    }}>
    {virtualColumns?.map((column) => (
      <div
        key={column?.key}
        style={{
          transform: `translateX(${column?.start}px)`,
          width: column?.size,
          height: row?.size
        }}>
        {row?.[row?.index]?.[column?.item?.code]}
      </div>
    ))}
  </div>
));

6. Optimizing Performance

Several performance optimizations enhance the grid’s responsiveness. The scroll margin property accounts for any offset elements like headers or navigation bars. Gap support creates consistent spacing between items without requiring additional wrapper elements. The initial measurements cache preserves previously calculated measurements, reducing recalculation overhead during navigation or filtering operations.

7. Integration with Data Management

The virtualized grid integrates seamlessly with state management and data fetching patterns. When combined with libraries like React Query, the implementation can handle real-time data updates while keeping scroll position and user context. The virtualizer automatically recalculates when the underlying data changes, making it suitable for frequent updates on the grid.

const { data: rows = [] } = useQuery({
  queryKey: ["gridData", page],
  queryFn: fetchRows,
  keepPreviousData: true,
});

Keep page-sized chunks in cache, drop far-away pages, and rehydrate from cache when users scroll back.

Implementation Best Practices

1. Buffering & Overscan

  • Always rendering a small number of rows/columns outside the screen dimensions avoid flicker when scrolling quickly and maintaining smoothness.

2. Efficient Row Height & Column Width Handling

  • Using fixed heights/widths if possible (simplifies calculations, faster)
  • If dynamic sizes are needed, caching row/column measurements. Using approximate size and adjust after render

3. Data Loading & Caching

  • Implementing lazy loading/infinite scrolling with virtualization
  • Caching previously loaded pages of data for back-scroll
  • Dropping far-off data for keeping memory usage in check

4. Performance Monitoring

Profiling the following using developer tools like Chromium browser’s performance tab, React profiler, Lighthouse:

  • FPS while scrolling
  • Memory usage from long-running sessions
  • CPU spikes from re-renders

5. A11Y

  • Using grid semantics like role=”grid”, aria-rowcount, aria-colcount
  • Implementing roving tabindex: only one tabbable cell at a time
  • Keyboard navigation: Arrow keys move focus within the virtualized region; handle Home/End/Page Up/Page Down
  • Exposing search or jump that operates on the dataset, not just visible DOM
  • Announcing loading/infinite scroll via aria-live regions

Benchmarking

To understand the real impact of virtualization, we tested a Data Grid with 100,000 rows × 20 columns (2 million cells) on a standard system.

Test System Specifications

  • CPU: Intel Core i5–1135G7 (4 cores, 8 threads, 2.4GHz base / 4.2GHz turbo) or equivalent mid-range processor
  • RAM: 16GB DDR4
  • Storage: 512GB SSD (NVMe)
  • Graphics: Integrated
  • Browser: Microsoft Edge version 140 (Latest stable at time of writing)

Test Results

IndicatorWithout VirtualizationWith Virtualization
DOM Nodes~2,000,000 elements~1,000 – 2,000 elements
Initial Render Time (TTFR)5 – 30s100 – 300ms
Memory Usage (steady)1 – 2GB+ heap50 – 100MB heap
Memory Spike (scrolling)+500MB – 1GB+10 – 30MB
Frame Rate (scrolling)<5 – 10FPS50 – 60FPS
Input Latency1 – 5s delay<50ms
CPU Utilization (scrolling)80 – 100 %20 – 40%

Roughly 35x faster rendering with a fraction of the memory footprint.

Closing Remarks

Implementing virtualization wasn’t just about speed — it was about sustainability. By rethinking how our grids render, we’ve reduced memory overhead, improved usability on lower-end devices, and simplified maintenance.

Other Articles you may like:

Know Your Best Performing Branches SFTP Thumbnail.webp
2024-01-01
Know Your Best Performing Branches by Surya’s Funds Transfer Pricing (FTP) Funds Transfer Pricing (FTP) is a sophisticated mechanism employed by banks and financial institutions to allocate and measure the profitability of funds transferred between different business units and product lines within the organization. At its core, FTP enables banks to assign economic value to the funds they use and generate, facilitating a granular analysis of profitability across various dimensions, including branches, product lines, customer relationships, and even individual accounts.Read more
Role of Asset LMS.webp
2024-01-01
Role of Asset Liability Management Systems in BankingALM - Asset Liability Management is a strategic approach used by banks to manage their Assets and Liabilities in a manner that ensures both liquidity and profitability while minimizing the risk. ALM involves monitoring, measuring, and managing various types of risks, including interest rate risk, liquidity risk, and market risk.Read more
Understanding the Importance.webp
2023-07-06
Understanding the Importance of Managing Interest Rate Risk on Banking BookInterest rate risk on the banking book (IRRBB) is a growing concern for banks worldwide, and the Reserve Bank of India has recently released guidelines for its management. Read more
galaxy
Reach out to know more
What People say?
“Indo Zambia Bank is proud to mention that we are the first Bank in Zambia, to have implemented ALM to manage our balance sheets with the help of Surya’s BALM tool. The entire product cycle from sale to customization, development and Implementation was done within 6 months to take care of our immediate needs. Along with their BALM product, we went ahead to use other reporting products like FTP, Prudential, RCSA, Register incident, BASEL II etc due to their stupendous tech and efficiency of their tools. The team from Surya has been accommodative and reactive to our changes and went along with us to deploy solutions in a time-bound manner.”
Harikrishna Bommareddy
CFO
At NBS Bank we decided to engage the services of Surya Software Systems for their Bank Balance Sheet/Assets and Liabilities management system and we are happy to share that it was a great decision. We utilize their solution to assist us on optimizing balance sheet strategies with the enhancement of information as their system produces versatile and timely reports suitable for our departmental needs. Having this system enables us to focus on strategic and regulatory balance sheet management knowing that all the assets and liabilities management reports are automated and accessible through their application.
Our experience in working with Surya has been very positive and we would highly recommend them as they are able to accommodate all client needs without compromising their service standards.
Neema Kitta Mojoo
Manager – Asset & Liability Management
In 2014, Doha Bank decided to move to a structured ALM solution and decided to implement Surya BALM. In addition, it was decided to procure a FTP system to meet the profitability measurement requirements. These systems were implemented successfully within in a short span of time in Qatar, Kuwait & UAE. A consolidator that aggregates ALM positions at the head office has also been implemented.
Surya has helped to significantly reduce the end of day processing time to under 45 minutes. Besides the central bank reporting, BALM has helped the bank produce Basel III liquidity reports. We are happy to have partnered with Surya, support from them has been reassuring.
Gaurav Dhingra
Head of Financial Risk
I have been working with Surya Software for 15 years. There were several projects for various companies as different as Street lighting control systems or Watch Retail. The capacity of Surya to understand properly the issues related to specific businesses, to answer quickly to complex proposals, and to deliver on time appropriate developments, have given satisfactory and confidence to the end-users vis-à-vis Surya.
Henri MABILLE
CIO
Surya-soft’s BALM software provides Axis Bank with a Bank-wide asset liability management system capable of handling granular ALM data for both its domestic as well as overseas operations on a daily basis as well as consolidate liquidity positions using BALM consolidator. It offers the Bank an enhanced platform to meet its liquidity and interest rate risk monitoring and analytics requirements in addition to meeting regulatory and internal reporting needs
Pravat Dash
SVP & Head (Market Risk)
“Indo Zambia Bank is proud to mention that we are the first Bank in Zambia, to have implemented ALM to manage our balance sheets with the help of Surya’s BALM tool. The entire product cycle from sale to customization, development and Implementation was done within 6 months to take care of our immediate needs. Along with their BALM product, we went ahead to use other reporting products like FTP, Prudential, RCSA, Register incident, BASEL II etc due to their stupendous tech and efficiency of their tools. The team from Surya has been accommodative and reactive to our changes and went along with us to deploy solutions in a time-bound manner.”
Harikrishna Bommareddy
CFO
At NBS Bank we decided to engage the services of Surya Software Systems for their Bank Balance Sheet/Assets and Liabilities management system and we are happy to share that it was a great decision. We utilize their solution to assist us on optimizing balance sheet strategies with the enhancement of information as their system produces versatile and timely reports suitable for our departmental needs. Having this system enables us to focus on strategic and regulatory balance sheet management knowing that all the assets and liabilities management reports are automated and accessible through their application.
Our experience in working with Surya has been very positive and we would highly recommend them as they are able to accommodate all client needs without compromising their service standards.
Neema Kitta Mojoo
Manager – Asset & Liability Management
In 2014, Doha Bank decided to move to a structured ALM solution and decided to implement Surya BALM. In addition, it was decided to procure a FTP system to meet the profitability measurement requirements. These systems were implemented successfully within in a short span of time in Qatar, Kuwait & UAE. A consolidator that aggregates ALM positions at the head office has also been implemented.
Surya has helped to significantly reduce the end of day processing time to under 45 minutes. Besides the central bank reporting, BALM has helped the bank produce Basel III liquidity reports. We are happy to have partnered with Surya, support from them has been reassuring.
Gaurav Dhingra
Head of Financial Risk
I have been working with Surya Software for 15 years. There were several projects for various companies as different as Street lighting control systems or Watch Retail. The capacity of Surya to understand properly the issues related to specific businesses, to answer quickly to complex proposals, and to deliver on time appropriate developments, have given satisfactory and confidence to the end-users vis-à-vis Surya.
Henri MABILLE
CIO
Surya-soft’s BALM software provides Axis Bank with a Bank-wide asset liability management system capable of handling granular ALM data for both its domestic as well as overseas operations on a daily basis as well as consolidate liquidity positions using BALM consolidator. It offers the Bank an enhanced platform to meet its liquidity and interest rate risk monitoring and analytics requirements in addition to meeting regulatory and internal reporting needs
Pravat Dash
SVP & Head (Market Risk)
“Indo Zambia Bank is proud to mention that we are the first Bank in Zambia, to have implemented ALM to manage our balance sheets with the help of Surya’s BALM tool. The entire product cycle from sale to customization, development and Implementation was done within 6 months to take care of our immediate needs. Along with their BALM product, we went ahead to use other reporting products like FTP, Prudential, RCSA, Register incident, BASEL II etc due to their stupendous tech and efficiency of their tools. The team from Surya has been accommodative and reactive to our changes and went along with us to deploy solutions in a time-bound manner.”
Harikrishna Bommareddy
CFO
At NBS Bank we decided to engage the services of Surya Software Systems for their Bank Balance Sheet/Assets and Liabilities management system and we are happy to share that it was a great decision. We utilize their solution to assist us on optimizing balance sheet strategies with the enhancement of information as their system produces versatile and timely reports suitable for our departmental needs. Having this system enables us to focus on strategic and regulatory balance sheet management knowing that all the assets and liabilities management reports are automated and accessible through their application.
Our experience in working with Surya has been very positive and we would highly recommend them as they are able to accommodate all client needs without compromising their service standards.
Neema Kitta Mojoo
Manager – Asset & Liability Management
In 2014, Doha Bank decided to move to a structured ALM solution and decided to implement Surya BALM. In addition, it was decided to procure a FTP system to meet the profitability measurement requirements. These systems were implemented successfully within in a short span of time in Qatar, Kuwait & UAE. A consolidator that aggregates ALM positions at the head office has also been implemented.
Surya has helped to significantly reduce the end of day processing time to under 45 minutes. Besides the central bank reporting, BALM has helped the bank produce Basel III liquidity reports. We are happy to have partnered with Surya, support from them has been reassuring.
Gaurav Dhingra
Head of Financial Risk
I have been working with Surya Software for 15 years. There were several projects for various companies as different as Street lighting control systems or Watch Retail. The capacity of Surya to understand properly the issues related to specific businesses, to answer quickly to complex proposals, and to deliver on time appropriate developments, have given satisfactory and confidence to the end-users vis-à-vis Surya.
Henri MABILLE
CIO
CLIENTS SERVED
© Copyright 2025 Surya Software Systems Pvt. Ltd. All Rights Reserved