Documentation

Performance Benchmark

Article author
Admin
  • Updated

We tested the parsing and validation speed (using .NET Stopwatch) and memory allocation of the .NET 6 version of EDI Tools for .NET.

Download EdiFabric EDI Tools 

Download EdiFabric EDI Tools from GitHub

 

Prerequisites

  • Configure the Template for splitting

    We did two tests for parsing and validation of the large file - with and without splitting. Following the steps in the Parsing large EDI files article, the [Splitter] attribute was added to the 2000 Loop in 835's template:

    [Splitter]
    [DataMember]
    [Required]
    [Pos(7)]
    public virtual List<Loop_2000_834> Loop2000 { get; set; }

    Don't forget to set Split = true to enable splitting in the Reader settings as explained in the Parsing large EDI files article (section Enable the splitting mode in EDI Reader)

  • Small file

    Download the file, that contains a single X12 5010 834 message with 2 employee enrollments. 

  • Large file

    Download the file, that contains a single X12 5010 834 message with 100 000 employee enrollments.

  • System Setup

    EdiFabric Version = 10.7.0

    .NET Version = NET6

    Visual Studio = Microsoft Visual Studio Community 2022 (64-bit) - 17.8.3

    OS = Windows 10 Home

    Processor = Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz 3.00 GHz

    RAM = 16.0 GB

 

Test the parsing speed

The code:

public static void Run()
{
   Stopwatch watch = Stopwatch.StartNew();
   var edi = File.OpenRead(@"C:\Hipaa_834_Large.txt");
   using (var ediReader = new X12Reader(edi, "EdiFabric.Templates.Hipaa", 
new X12ReaderSettings { Split = false })) { while (ediReader.Read()) { } } watch.Stop(); Console.Write(watch.ElapsedMilliseconds); Console.ReadKey(); }

The results:

Test Elapsed Allocated at start Allocated at end
Small file 149 ms 1 MB 33 MB
Large file 39 s 1 MB 390 MB
Large file with splitting 44 s 1 MB 31 MB

 

Test the validation speed

The code:

public static void Run()
{
var validation = new List<Task<Tuple<bool, MessageErrorContext>>>(); Stopwatch watch = Stopwatch.StartNew(); var edi = File.OpenRead(@"C:\Hipaa_834_Large.txt"); using (var ediReader = new X12Reader(edi, "EdiFabric.Templates.Hipaa",
new X12ReaderSettings { Split = false })) { while (await ediReader.ReadAsync())
{
MessageErrorContext mec;
var msg = ediReader.Item as TS834;
if (msg != null)
{
validation.Add(msg.IsValidAsync());
}
} }
Task.WaitAll(validation.ToArray()); watch.Stop(); Console.Write(watch.ElapsedMilliseconds); Console.ReadKey(); }

The results:

Test Elapsed Allocated at start Allocated at end
Small file 280 ms 1 MB 31 MB
Large file 3 min 1 MB 3.2 GB
Large file with splitting 1 min 1 MB 170 MB

 

How to test my own files?

To evaluate your own files head on to the Demo project in each solution, and change the path to a local file on your machine.

Share this:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.