We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It's a waste of dev time, imho. Karatsuba algo replaces 2mul+1add with 1mul+4add. They say mul takes 3-4 times cycles of add these days, so you gonna get max 12.5% speed up (or zero, if it's actually 3 times) for the code which probably takes less than 20% of execution time (memory access will be the bottleneck, not number crunching)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Modified
You are viewing a single comment's thread. Return to all comments →
It's a waste of dev time, imho. Karatsuba algo replaces 2mul+1add with 1mul+4add. They say mul takes 3-4 times cycles of add these days, so you gonna get max 12.5% speed up (or zero, if it's actually 3 times) for the code which probably takes less than 20% of execution time (memory access will be the bottleneck, not number crunching)