Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Can you optimize my fibs?

Name: Anonymous 2015-12-16 17:07

Hi /frog/,

I've been tweaking my fibs implementation and it still seems slow in some cases.

How could I make it faster? Any ideas? Any obvious optimilizations I'm missing here?

fibs:
cmp rdi, 1
ja .l1
mov rax, rdi
ret
.l1:
dec rdi
push rdi
call fibs
pop rdi
push rax
dec rdi
call fibs
pop rcx
add rax, rcx
ret

Name: Anonymous 2015-12-18 18:55

>>22
I'm sure it could be 8x or slightly more in properly written asm (read compiler generated, and manually tidied up).

This isn't always the case, if you look in the bignum thread, suigin dispelled the myth that the compiler knows best. He's outperforming the compiler by a factor of 4x for bignum multiplication.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List