We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Performance

We upgraded the version of Aspose.BarCode in our product from 3.0.1.1211 to 7.2.0.0 for better barcode detection. Though we observed a improved detection but we have experienced extreme performance issues with the new version.

While version 3.0 recognised the barcodes on a simple small image (attached) in 60-65 ms, the new version 7.2 worked for about 300 ms. The time duration is about 5 times than the old version even though the symbology is restricted to DataMatrix in both the versions. The library with this speed is unusable.

We have multiple customers in a state where they basically can't work as a result of performance at a point that makes it unusable. All of these issues did not surface until we upgraded.

To reproduce the issue, we have made two C++ console applications (.exe) using DataMatrix barcode. The sample input bmp file is attached.

Program for 7.2.0.0
-------------------------
#include
#include
#include

using namespace System;

#using "System.Drawing.Dll"
using namespace System::Drawing;
using namespace System::Diagnostics;

using namespace Aspose::BarCode;
using namespace Aspose::BarCodeRecognition;

static void ProcessBarcode();

int main ()
{
int iReturn = 0;

ProcessBarcode();

return iReturn;
}

static void ProcessBarcode()
{

Aspose::BarCode::License ^lic = gcnew Aspose::BarCode::License();

lic->SetLicense("Aspose.BarCode.Lic");

Stopwatch^ watch = gcnew Stopwatch();

watch->Start();

String^ imgPath = gcnew String("image.bmp");
Bitmap^ image = gcnew Bitmap (imgPath);

BarCodeReader ^br = gcnew BarCodeReader(image, BarCodeReadType::DataMatrix);

if (br->Read())
{
printf("\nContent: %s", br->GetCodeText() );
}

watch->Stop();
printf("\n\nElapsed time %lld milliseconds", watch->ElapsedMilliseconds);
getch();
}

Program for 3.0.1.1211
-------------------------------
#include
#include
#include

using namespace System;

#using "System.Drawing.Dll"
using namespace System::Drawing;
using namespace System::Diagnostics;

using namespace Aspose::BarCode;

static void ProcessBarcode();

int main ()
{
int iReturn = 0;

ProcessBarcode();

return iReturn;
}

static void ProcessBarcode()
{

Aspose::BarCode::License ^lic = gcnew Aspose::BarCode::License();

lic->SetLicense("Aspose.BarCode.Lic");

Stopwatch^ watch = gcnew Stopwatch();

watch->Start();

String^ imgPath = gcnew String("image.bmp");
Bitmap^ image = gcnew Bitmap (imgPath);

BarCodeReader ^br = gcnew BarCodeReader(image);
br->BarCodeReadType = BarCodeReadType::DataMatrix;
array^pResults = br->Read();

BarCodeInfo ^currentBarCodeInfo = pResults[0];

// get length of the Barcode
array^ CodeBytes = currentBarCodeInfo->CodeBytes;
long lCharLen = CodeBytes->Length;

if (lCharLen)
{
char *pchNewBarcode = new char [lCharLen + 1];

pchNewBarcode[lCharLen] = 0x00;

for (long lCharCnt = 0; lCharCnt < lCharLen; lCharCnt++)
{
pchNewBarcode[lCharCnt] = (char) CodeBytes[lCharCnt];
}

printf("\nContent: %s", pchNewBarcode );
}

watch->Stop();
printf("\n\nElapsed time %lld milliseconds", watch->ElapsedMilliseconds);
getch();
}
Hi,

Thank you for your inquiry and sharing information.

This is to update you that it is always recommended to use latest version of the API. Enhancement and improvement is a continuous process. The version you are referring is old. Please download the latest version Aspose.BarCode for .NET 16.11.0 and try it at your end. In case the issue persists, feel free to contact us along with details and sample. We will investigate the issue and update you accordingly via this forum thread.

Hi,

I have downloaded the latest version Aspose.Barcode for .Net 16.11.0.0. When I tried to integrate the new dll in our code (using temporary license), I am getting an exception -“Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection” from Read() function. But there was not such issue with v7.2.0.0. Could you please let me know the reason.

Test code to reproduce the issue-

using namespace System;

#using "System.Drawing.Dll"
using namespace System::Drawing;
using namespace Aspose::BarCode;

using namespace Aspose::BarCode::BarCodeRecognition ;

static void ProcessBarcode();

int main ()
{
int iReturn = 0;

ProcessBarcode();

return iReturn;
}

static void ProcessBarcode()
{

Aspose::BarCode::License ^lic = gcnew Aspose::BarCode::License();

lic->SetLicense(“Aspose.BarCode.Lic”);

String^ imgPath = gcnew String(“img_16_notworking.bmp”);
Bitmap^ image = gcnew Bitmap (imgPath);

SingleDecodeType^ singleType = DecodeType::DataMatrix;

BarCodeReader ^br = gcnew BarCodeReader(image, singleType);

bool bResult = false;

try
{
bResult = br->Read();
}

catch (Exception^ eMsg)
{
}
}

I have also attached the followings -
1. img_16_notworking.bmp - works with v7.2.0.0 but throws an exception with v16.11.0
2. Project_properties - to give you an idea about other dependent libraries
Hi,

Thank you for writing us back.

This is to update you that we have investigated the issue at our end. Initial investigation shows that issue persists. The issue has been logged into our system with ID BARCODENET-36398. Our product team will further look into it. We will update you with the progress via this forum thread.

The issues you have found earlier (filed as BARCODENET-36398) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,

Could you please provide an update regarding original issue which was raised for performance hit. Though the issue “Offset and length were out of bounds for the array…” which was logged with ID BARCODENET-36398 is fixed in v16.12 but I still observe the same performance hit with that version also. I have even checked with your latest .Net Aspose.BarCode v17.5 and that is no different.

All of our customers who have upgraded to .Net Aspose.BarCode v7.2 for better barcode detection are facing the 6-7 times performance hit that makes them unusable. Please provide an update when this will be fix.

@emtexltd,

Thank you for writing us back. Please download the latest version Aspose.BarCode for .NET 17.7 and try it at your end. Forward us your feedback in case the issue persists. We will look into it and update you about our findings.