Our software uses Aspose BarCode for .NET 4.0 version 23.9. We’ve purchased new license to to use new QualitySettings. Unfortunately performance is much slower for some barcodes even in HighPerformance QualitySetting.
I’ve got following results:
With specified DecodeType.Interleaved2of5
23.9 - < 10ms
25.5 - ~ 180ms (default)
25.5 - ~ 90 ms (HighPerformance)
Without specified DecodeType.Interleaved2of5
23.9 - ~ 130ms
25.5 - ~ 500ms (default)
25.5 - ~ 250 ms (HighPerformance)
For provided barcodes new version is much slower even in HighPerformance.
Following code is used:
var bmp1 = @"4.png";
for (int i = 0; i < 10; i++)
{
System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
//using (Aspose.BarCode.BarCodeRecognition.BarCodeReader reader1 = new Aspose.BarCode.BarCodeRecognition.BarCodeReader(bmp1, Aspose.BarCode.BarCodeRecognition.DecodeType.Code39Standard))
using (Aspose.BarCode.BarCodeRecognition.BarCodeReader reader1 = new Aspose.BarCode.BarCodeRecognition.BarCodeReader(bmp1))
{
//reader1.QualitySettings = QualitySettings.HighPerformance;
foreach (Aspose.BarCode.BarCodeRecognition.BarCodeResult result1 in reader1.ReadBarCodes())
{
// Read symbology type and code text
Console.WriteLine("Symbology Type: " + result1.CodeType);
Console.WriteLine("CodeText: " + result1.CodeText);
}
}
Console.WriteLine(sw.ElapsedMilliseconds.ToString());
}
Console.ReadKey();
The performance slowdown you are experiencing when upgrading from version 23.9 to 25.5 of Aspose.BarCode for .NET is likely due to changes in the underlying algorithms for barcode recognition and how the library manages different quality settings. The increase in processing time, even with the HighPerformance quality setting, indicates that the new version may be utilizing more complex recognition techniques that require additional computation.
Solution
To optimize performance in the newer version, consider the following steps:
Quality Settings: Ensure that you are explicitly setting the QualitySettings to HighPerformance in your code. This setting is designed to enhance speed, but you may also want to experiment with other settings to find the best balance for your specific barcodes.
Image Quality: The quality of the input images can significantly affect recognition speed. Ensure that the images you are using are of good quality and suitable for barcode recognition.
Decode Type: If you are using a specific DecodeType, ensure that it is necessary for your application. Using a more general decode type may improve performance.
Profile Performance: Use profiling tools to identify bottlenecks in your code. This can help you understand where the slowdown is occurring and whether it’s related to the library or your implementation.
Code
Here’s a modified version of your code that explicitly sets the QualitySettings:
var bmp1 = @"4.png";
for (int i = 0; i < 10; i++)
{
System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
using (Aspose.BarCode.BarCodeRecognition.BarCodeReader reader1 = new Aspose.BarCode.BarCodeRecognition.BarCodeReader(bmp1))
{
// Set high performance mode
reader1.QualitySettings = QualitySettings.HighPerformance;
foreach (Aspose.BarCode.BarCodeRecognition.BarCodeResult result1 in reader1.ReadBarCodes())
{
Console.WriteLine("Symbology Type: " + result1.CodeType);
Console.WriteLine("CodeText: " + result1.CodeText);
}
}
Console.WriteLine(sw.ElapsedMilliseconds.ToString());
}
Console.ReadKey();
Next Steps
Test the modified code to see if there is an improvement in performance.
If performance issues persist, reach out to Aspose support with specific details about the barcodes and images you are using.
Review the documentation on recognition quality settings to explore other options that may enhance performance for your specific use case.
Please implement these suggestions and let me know if you see an improvement!
After initial testing, I am able to reproduce the issue as you mentioned by using your barcode image(s). I found barcode recognition performance has slowed down.
We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): BARCODENET-39351
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
We are pleased to inform you that your issue (Ticket ID: “BARCODENET-39351”) has been resolved. The fix/enhancement will be included in the upcoming release (Aspose.BarCode v25.7) that we plan to release in the second half of July 2025.
Please try the latest version, Aspose.BarCode for .NET 25.7 (Downloads | NuGet). The issue you reported (logged as “BARCODENET-39351”) has been resolved in this update.
The performance slowdown you’re seeing in Aspose.BarCode v25.5, even with QualitySettings.HighPerformance, is likely due to internal changes in the decoding engine that prioritize accuracy and broader symbology support at the cost of speed. To mitigate this, explicitly set the DecodeType (e.g., DecodeType.Interleaved2of5) and avoid auto-detection where possible, as unspecified types increase processing time. Also, try using QualitySettings.ManualHints with fine-tuned parameters like AllowIncorrectBarcodes or reducing the MaxBarCodesToRecognizePerPage if applicable to further optimize performance.