|
|
|
|
|
by rasz
207 days ago
|
|
At the very moment person in charge says "ok this works, now make it not slow". Python is modern age BASIC. Easy to write and good for prototypes, scripting, gluing together libraries, fast iterations. If you want performance and heavy data processing anything else will be better. PHP, Java, even JavaScript. For example Python is struggling to reach real time performance decoding RLL/MFM data off of ancient 40 year old hard drives (https://github.com/raszpl/sigrok-disk). 4GHz CPU and I cant break 500KB/s in a simple loop: for i in range(len(data)):
decoder.shift = ((decoder.shift << data[i]) + 1) & 0xffffffffff
decoder.shift_index += data[i]
if decoder.shift_index >= 16:
decoder.shift_index -= 16
decoder.shift_byte = (decoder.shift >> decoder.shift_index) & 0x5555
decoder.shift_byte = (decoder.shift_byte + (decoder.shift_byte >> 1)) & 0x3333
decoder.shift_byte = (decoder.shift_byte + (decoder.shift_byte >> 2)) & 0x0F0F
decoder.shift_byte = (decoder.shift_byte + (decoder.shift_byte >> 4)) & 0x00FF
|
|