[Gambas-user] "shared library" (with inline assembler code) is slow...

Emil Lenngren emil.lenngren at ...626...
Sun Jun 3 01:02:46 CEST 2012


Is the function itself slow or is it slow because of the call overhead of
libffi?

/Emil

2012/6/3 Ru Vuott <vuott at ...325...>

> Hello Benoit,
>
> simply for a test I've made this simple C "shared library" .so (with
> inline assembler code). I noted that if I use it from a Gambas program
> (with Extern) it's very slow. Why?
>
> static unsigned int car asm("raxregistro");
> static unsigned int cbr asm("rbxregistro");
> int hello(int numero) {
> cbr=numero;
> asm("mov rbxregistro(%rip),%eax");
> asm("ciclo:");
> asm("dec %eax");
> asm("jne ciclo");
> asm("mov %eax,raxregistro(%rip)");
> return car;
> }
>
> Bye
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list