question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We render alot of invoices and we want to add a QRCode so that users can scan the invoice with their phone. Since we render several thousand invoices performance is important. I noticed it took 25ms to render the image when warm. I used the code from readme

QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(20);

Included in the 25 Ms is saving the bitmap to a memory stream and convert it to a byte array.

We are using full framework 4.7 and the computer i tested on is a AMD 5950x. Latest nuget version

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
codebudecommented, Nov 23, 2021

Hi @AndersMalmgren ,

If I read your comments correctly, you had the best performance when using the PngByteQRCode, but couldn’t use this renderer because you didn’t want the whitespace (=quiet zone). Correct?

In the latest CI build (and soon officially when I push version 1.4.2 to NuGet) there is now a new/additional parameter “drawQuietZones” available for the PngByteQRCode. If you set this to “false”, the codes will be rendered without quiet zones. With this you could take advantage of the performance benefits of the PngByteQR code.

0reactions
FawzyMokhtarcommented, Jan 19, 2022

It’s good to say that using the PngByteQRCode instead of the BitmapByteQRCode reduced the amount of memory used - in that step - from 19mb to actually NOTHING which is WooW.

I think the problem maybe with the BitmapByteQRCode itself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing With Poor Performance - Lack of Ability, or Low ...
The two causes of poor performance – lack of ability and low motivation – are inextricably intertwined, and goal setting, feedback, and a...
Read more >
The Real Reasons Behind Low Performance (And How To ...
Causes Of Low Performance. Very rarely is someone in the lowest rank because they are incompetent or lazy. If you are hiring qualified...
Read more >
Managing Poor Performance: 5 Steps
By definition, poor work performance occurs when an employee fails to fulfill the expectations or responsibilities of their job. An employee may also...
Read more >
What Is Poor Performance and How Can You Manage It?
Poor performance is the collection of performances, outputs, or attitudes that fall below a standard. This broad definition means poor ...
Read more >
How to Address Poor Work Performance
Here are the most important steps and tips to handle poor work performance on your team, so they can get back on track...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found