Closed cryptogun closed 6 years ago
Yes, adding the ability to skip best_mask_pattern
sounds like a good idea.
@SmileyChris Thank you for the reply. I just made a pull request. Check it out :) Still not fast enough, and heavy CPU usage. Maybe I should use large lookup tables. I'll make it in my own forked branch if it is not suitable for everyone use.
@SmileyChris @cryptogun I'm running into a similar issue where I am using multiprocessing to generate 10k records, where the qrcode svg generation is a bottleneck and currently much too slow. Is there a way to speed things up? There aren't docs that I saw for the above mark_pattern attribute so unsure how to use it. Thanks!
Since the low performance described in #124 , it's better to allow user to skip the best_mask_pattern procedure if he/she knows the consequence and is willing to take that risk. My argument is as follows:
def make(): qr = qrcode.QRCode( version=6, error_correction=qrcode.constants.ERROR_CORRECT_H, box_size=10, border=4, ) qr.add_data('HELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO') qr.make(fit=True)
start = time.time() for i in range(100): make() end = time.time() print(end-start)