# Benchmarking TX Text Control: Classic vs. Core on Windows and Linux

> With the release of the new core version of TX Text Control, we set out to benchmark its performance against the classic version on both Windows and Linux environments. This comparison provides valuable insights into speed, efficiency and cross-platform capabilities.

- **Author:** Bjoern Meyer
- **Published:** 2025-03-14
- **Modified:** 2025-11-16
- **Description:** With the release of the new core version of TX Text Control, we set out to benchmark its performance against the classic version on both Windows and Linux environments. This comparison provides valuable insights into speed, efficiency and cross-platform capabilities.
- **6 min read** (1034 words)
- **Tags:**
  - ASP.NET Core
  - ASP.NET
  - Linux
  - Benchmark
- **Web URL:** https://www.textcontrol.com/blog/2025/03/14/benchmarking-tx-text-control-classic-vs-core-on-windows-and-linux/
- **LLMs URL:** https://www.textcontrol.com/blog/2025/03/14/benchmarking-tx-text-control-classic-vs-core-on-windows-and-linux/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2025/03/14/benchmarking-tx-text-control-classic-vs-core-on-windows-and-linux/llms-full.txt

---

Performance is a critical factor for developers working with high-volume document creation and manipulation. As TX Text Control expands its capabilities with the new *Core* version, we decided to benchmark its performance against the *Classic* version on both Windows and Linux environments.

Based on the many changes required to port TX Text Control to Linux, we have significantly improved the performance of document processing. We took a bold step by developing a custom rendering foundation based entirely on SVG (Scalable Vector Graphics). This approach provides more control over the rendering process, ensuring high quality output and seamless cross-platform compatibility. By eliminating reliance on external libraries, the new system improves flexibility, performance, and long-term maintainability, making it a robust solution for rendering across multiple environments.

TX Text Control for Linux introduces a completely rewritten font rendering system to ensure cross-platform compatibility. Previously dependent on Windows-specific technologies, the new system is now platform-independent and delivers accurate, high-quality font rendering without sacrificing speed and efficiency.

Together, these enhancements deliver faster, more efficient, and highly scalable document processing. The purpose of this benchmark is to demonstrate the significant performance improvements.

### Benchmark Setup

For our benchmark, we created a test suite that measures the execution time for various document operations. The test scenarios include:

- **Table insertion**: Adding a large table (500 rows, 10 columns) and adding text to all table cells (5000 cells).
- **Image insertion**: Inserting 500 images into a document.
- **Text formatting**: Applying 500 random formatting manipulations.

The benchmarking tool was built as a C# console application using the Classic and Core versions of TX Text Control. The Core version has been tested on both Windows and Linux. The test was performed on a Windows 11 machine and a Linux Docker container. The system specifications are not relevant as the comparison between the two is important.

The benchmarking tool repeats the same test five times in a loop. The average execution time is then calculated.

### Results

The following results show the average execution time for each test scenario:

| Test Case | Classic Windows | Core Windows | Core Linux |
|---|---|---|---|
| Table insertion | 11297ms | 7476ms | 7321ms |
| Image insertion | 952ms | 40ms | 34ms |
| Text formatting | 1783ms | 86ms | 96ms |

The benchmark results show significant performance improvements with TX Text Control Core, demonstrating its efficiency across multiple operations.

Table insertion in TX Text Control Core showed a **33.8% reduction in execution time** on Windows, dropping from 11297ms in TX Text Control Classic to 7476ms. On Linux, the performance was slightly better at 7321ms, a **35.2% improvement** over TX Text Control Classic. This improvement is largely due to TX Text Control Core's optimized low-level drawing engine and better memory allocation strategies that allow for faster table rendering and data population.

Image insertion showed the most significant performance improvement. In TX Text Control Classic, inserting 5000 images took 952ms, while TX Text Control Core accomplished the same task in just 40ms on Windows and 34ms on Linux. This represents a **95.8% reduction in execution time** on Windows and a **96.4% improvement** on Linux.

Text formatting operations also showed impressive acceleration. TX Text Control Classic took 1783ms to perform 500 random formatting operations, while TX Text Control Core completed the same operation in just 86ms on Windows and 96ms on Linux. This represents a **95.2% reduction in execution time** on Windows and a **94.6% improvement** on Linux.

The following chart illustrates the percentage improvement of TX Text Control Core over the Classic version.

![TX Text Control Linux Performance](https://s1-www.textcontrol.com/assets/dist/blog/2025/03/14/a/assets/performance.webp "TX Text Control Linux Performance")

The next figure shows how much faster the Core version is compared to the Classic version.

![TX Text Control Linux Performance](https://s1-www.textcontrol.com/assets/dist/blog/2025/03/14/a/assets/performance2.webp "TX Text Control Linux Performance")

### Benchmark Test Classes

For full transparency, the following code snippets show the test classes that are used in the benchmarking tool:

```
using System.Diagnostics;
using System.Drawing;
using System.Security.Cryptography;
using TXTextControl;

class Benchmark
{
    public enum TestType
    {
        Table,
        Images,
        Formatting
    }

    public const int Rows = 500;
    public const int Cols = 10;
    public const int Images = 500;
    public const int Iterations = 5;

    public double Run(TestType testType)
    {
        double totalTime = 0;

        for (int i = 0; i < Iterations; i++)
        {
            using (ServerTextControl tx = new ServerTextControl())
            {
                tx.Create();
                
                Stopwatch stopwatch = Stopwatch.StartNew();

                switch (testType)
                {
                    case TestType.Table:
                        TableInserter.InsertTable(tx);
                        break;
                    case TestType.Images:

                        // read image from file
                        byte[] imageBytes = File.ReadAllBytes("Images/signature2.png");

                        ImageInserter.InsertImages(tx, Images, imageBytes);
                        break;
                    case TestType.Formatting:

                        tx.Load("Documents/sample.tx", StreamType.InternalUnicodeFormat);

                        TextFormatter.ApplyRandomFormatting(tx, 500);
                        break;
                }

                stopwatch.Stop();
                totalTime += stopwatch.ElapsedMilliseconds;

                //tx.Save("results.pdf", StreamType.AdobePDF);  
            }
        }
        return totalTime / Iterations;
    }
}

class TableInserter
{
    public static void InsertTable(ServerTextControl tx)
    {
        tx.Tables.Add(Benchmark.Rows, Benchmark.Cols, 13);
        Table table = tx.Tables.GetItem(13);

        for (int r = 1; r < Benchmark.Rows; r++)
        {
            for (int c = 1; c < Benchmark.Cols; c++)
            {
                table.Cells[r, c].Text = $"Cell {r},{c}";
            }
        }
    }
}

class ImageInserter
{
    public static void InsertImages(ServerTextControl tx, int imageCount, byte[] imageBytes)
    {
        // publicly visible Memory stream for the image
        using (MemoryStream ms = new MemoryStream(
            imageBytes, 0, imageBytes.Length, writable: false, publiclyVisible: true))
        {
            for (int i = 0; i < imageCount; i++)
            {
                TXTextControl.Image img = new TXTextControl.Image(ms);
                tx.Images.Add(img, -1);
            }
        }
    }
}

class TextFormatter
{
    public static void ApplyRandomFormatting(ServerTextControl tx, int manipulations)
    {
        int textLength = tx.Text.Length;
        for (int i = 0; i < manipulations; i++)
        {
            int start = RandomUtil.GetSecureRandomNumber(0, textLength - 1);
            int length = RandomUtil.GetSecureRandomNumber(1, Math.Min(10, textLength - start));

            tx.Select(start, length);
            tx.Selection.Bold = RandomUtil.GetSecureRandomBool();

            if (RandomUtil.GetSecureRandomBool())
                tx.Selection.GrowFont();
            else
                tx.Selection.ShrinkFont();

            tx.Selection.ForeColor = RandomUtil.GetSecureRandomColor();
        }
    }
}

class RandomUtil
{
    public static int GetSecureRandomNumber(int min, int max)
    {
        byte[] data = new byte[4];
        RandomNumberGenerator.Fill(data);
        int value = BitConverter.ToInt32(data, 0) & int.MaxValue;
        return min + (value % (max - min + 1));
    }

    public static bool GetSecureRandomBool()
    {
        byte[] data = new byte[1];
        RandomNumberGenerator.Fill(data);
        return (data[0] & 1) == 1;
    }

    public static Color GetSecureRandomColor()
    {
        return Color.FromArgb(
            GetSecureRandomNumber(0, 255),
            GetSecureRandomNumber(0, 255),
            GetSecureRandomNumber(0, 255)
        );
    }
}
```

### Conclusion

TX Text Control Core for Linux offers significant performance improvements over the Classic version, demonstrating its efficiency in various document operations. The new rendering foundation based on SVG and the platform-independent font rendering system have significantly improved the speed and efficiency of document processing. The benchmark results show that TX Text Control Core is a robust solution for high-volume document creation and manipulation, delivering faster, more efficient and highly scalable performance.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Document Editor with TX Spell .NET on Linux using ASP.NET Core](https://www.textcontrol.com/blog/2026/01/28/document-editor-tx-spell-net-linux-aspnet-core/llms.txt)
- [Convert MS Word DOCX to PDF including Text Reflow using .NET C# on Linux](https://www.textcontrol.com/blog/2025/06/10/convert-ms-word-docx-to-pdf-including-text-reflow-using-dotnet-csharp-on-linux/llms.txt)
- [Announcing the Official DS Server Docker Image on Docker Hub](https://www.textcontrol.com/blog/2025/05/02/announcing-the-official-ds-server-docker-image-on-docker-hub/llms.txt)
- [Introducing DS Server 4.0: Linux-Ready and Container-Friendly](https://www.textcontrol.com/blog/2025/04/30/introducing-ds-server-4-linux-ready-and-container-friendly/llms.txt)
- [Creating a .NET Console Application with Visual Studio Code and TX Text Control (on Linux)](https://www.textcontrol.com/blog/2025/04/03/creating-a-dotnet-console-application-with-visual-studio-code-and-tx-text-control-on-linux/llms.txt)
- [TX Text Control Core vs. Classic Performance Comparison Plain Text to DOCX and PDF](https://www.textcontrol.com/blog/2025/03/31/2025-03-31-tx-text-control-core-vs-classic-performance-comparison-plain-text-to-docx-and-pdf/llms.txt)
- [How to Create PDF Documents with TX Text Control using C# .NET on Linux](https://www.textcontrol.com/blog/2025/03/18/how-to-create-pdf-documents-with-tx-text-control-using-c-sharp-net-on-linux/llms.txt)
- [Introducing TXTextControl.Web.Server.Core: A Cross-Platform Backend for TX Text Control Document Editor](https://www.textcontrol.com/blog/2025/03/13/introducing-txtextcontrol-web-server-core-a-cross-platform-backend-for-tx-text-control-document-editor/llms.txt)
- [Using TX Text Control with Ultra-Minimal Chiseled Linux Containers](https://www.textcontrol.com/blog/2025/03/12/using-tx-text-control-with-ultra-minimal-chiseled-linux-containers/llms.txt)
- [Getting Started: Document Editor with ASP.NET Core and Docker Support with Linux Containers](https://www.textcontrol.com/blog/2025/03/12/getting-started-document-editor-with-asp-net-core-and-docker-support-with-linux-containers/llms.txt)
- [Version 33.0 Preview: NuGet Packages Explained and Why we Minimize Dependencies](https://www.textcontrol.com/blog/2025/02/24/version-33-0-preview-nuget-packages-explained-and-why-we-minimize-dependencies/llms.txt)
- [TX Text Control Linux Preview: Font Handling](https://www.textcontrol.com/blog/2024/12/28/tx-text-control-linux-preview-font-handling/llms.txt)
- [TX Text Control for Linux Preview: Document Processing in ASP.NET Core on Azure App Services](https://www.textcontrol.com/blog/2024/12/17/tx-text-control-for-linux-preview-document-processing-in-asp-net-core-on-azure-app-services/llms.txt)
- [Hello Linux! Almost There - A Game-Changer for Document Processing](https://www.textcontrol.com/blog/2024/12/12/hello-linux-almost-there-a-game-changer-for-document-processing/llms.txt)
- [5 Layout Patterns for Integrating the TX Text Control Document Editor in ASP.NET Core C#](https://www.textcontrol.com/blog/2026/04/09/5-layout-patterns-for-integrating-the-tx-text-control-document-editor-in-aspnet-core-csharp/llms.txt)
- [Extracting Structured Table Data from DOCX Word Documents in C# .NET with Domain-Aware Table Detection](https://www.textcontrol.com/blog/2026/04/03/extracting-structured-table-data-from-docx-word-documents-in-csharp-dotnet-with-domain-aware-table-detection/llms.txt)
- [Introducing Text Control Agent Skills](https://www.textcontrol.com/blog/2026/03/27/introducing-text-control-agent-skills/llms.txt)
- [Deploying the TX Text Control Document Editor from the Private NuGet Feed to Azure App Services (Linux and Windows)](https://www.textcontrol.com/blog/2026/03/25/deploying-the-tx-text-control-document-editor-from-the-private-nuget-feed-to-azure-app-services-linux-and-windows/llms.txt)
- [Why Structured E-Invoices Still Need Tamper Protection using C# and .NET](https://www.textcontrol.com/blog/2026/03/24/why-structured-e-invoices-still-need-tamper-protection-using-csharp-and-dotnet/llms.txt)
- [AI Generated PDFs, PDF/UA, and Compliance Risk: Why Accessible Document Generation Must Be Built Into the Pipeline in C# .NET](https://www.textcontrol.com/blog/2026/03/23/ai-generated-pdfs-pdf-ua-and-compliance-risk-why-accessible-document-generation-must-be-built-into-the-pipeline-in-c-sharp-dot-net/llms.txt)
- [File Based Document Repository with Version Control in .NET with TX Text Control](https://www.textcontrol.com/blog/2026/03/20/file-based-document-repository-with-version-control-in-dotnet/llms.txt)
- [Create Fillable PDFs from HTML Forms in C# ASP.NET Core Using a WYSIWYG Template](https://www.textcontrol.com/blog/2026/03/17/create-fillable-pdfs-from-html-forms-in-csharp-aspnet-core-using-a-wysiwyg-template/llms.txt)
- [Why HTML to PDF Conversion is Often the Wrong Choice for Business Documents in C# .NET](https://www.textcontrol.com/blog/2026/03/13/why-html-to-pdf-conversion-is-often-the-wrong-choice-for-business-documents-in-csharp-dot-net/llms.txt)
- [Inspect and Process Track Changes in DOCX Documents with TX Text Control with .NET C#](https://www.textcontrol.com/blog/2026/03/10/inspect-and-process-track-changes-in-docx-documents-with-tx-text-control-with-dotnet-csharp/llms.txt)
- [Text Control at BASTA! Spring 2026 in Frankfurt](https://www.textcontrol.com/blog/2026/03/06/text-control-at-basta-spring-2026-in-frankfurt/llms.txt)
