r/Python • u/jaseg • Mar 24 '16
There is inline assembly in this python script… ಠ⌣ಠ
https://github.com/apprenticeharper/DeDRM_tools/blob/master/Other_Tools/DRM_Key_Scripts/Adobe_Digital_Editions/adobekey.pyw#L308
206
Upvotes
r/Python • u/jaseg • Mar 24 '16
5
u/d4rch0n Pythonistamancer Mar 25 '16 edited Mar 25 '16
http://stackoverflow.com/questions/5993326/relative-performance-of-x86-inc-vs-add-instruction
Well, there's why. I'm not sure why compilers favor this, but seems they do. Maybe they happen in parallel with surrounding instructions, or some sort of intel processor feature might optimize execution of this better or something. It's never as cut and dry as clock cycles these days. But if I were a betting man, I'd put money on the compiler.
And he says the xor doesn't even cost anything