WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: New feature in Gambas 3

Re: "shared library" (with inline assembler code) is slow...

by Emil Lenngren :: Rate this Message:

| View in Thread

... And how big is the difference if you put in 2 billion instead? :)

2012/6/3 Ru Vuott <vuott@...>

> Excuse me, Emil, I have written a mistake:
> well, if I send 1 billion with script in terminal, I receive about: ms 570
>
> with shared library in gambas I confirm about. 655
>
>
> Difference: ms 100
>
>
>
>
> --- Dom 3/6/12, Emil Lenngren <emil.lenngren@...> ha scritto:
>
> > Da: Emil Lenngren <emil.lenngren@...>
> > Oggetto: Re: [Gambas-user] "shared library" (with inline assembler code)
> is slow...
> > A: "mailing list for gambas users" <gambas-user@...>
> > Data: Domenica 3 giugno 2012, 01:10
> > What happens if you put 2 billions
> > instead?
> >
> > 2012/6/3 Ru Vuott <vuott@...>
> >
> > > If I run that code via script in my Terminal, passing
> > to it a value of 1
> > > billion (it has to count from 0 to 1 billion), I have a
> > result about 60
> > > millisecond.
> > > If I create a shared library, and I use it in Gambas
> > (...passing 1
> > > billion...), in gambas console I have about 655
> > millisecond !!!  :-O
> > >
> > > ...I do not understand why....
> > >
> > >
> > >
> > >
> > > --- Dom 3/6/12, Emil Lenngren <emil.lenngren@...>
> > ha scritto:
> > >
> > > > Da: Emil Lenngren <emil.lenngren@...>
> > > > Oggetto: Re: [Gambas-user] "shared library" (with
> > inline assembler code)
> > > is slow...
> > > > A: "mailing list for gambas users" <
> gambas-user@...>
> > > > Data: Domenica 3 giugno 2012, 01:02
> > > > Is the function itself slow or is it
> > > > slow because of the call overhead of
> > > > libffi?
> > > >
> > > > /Emil
> > > >
> > > > 2012/6/3 Ru Vuott <vuott@...>
> > > >
> > > > > 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@...
> > > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > > >
> > > >
> > >
> >
> ------------------------------------------------------------------------------
> > > > 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@...
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > >
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > > 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@...
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> >
> ------------------------------------------------------------------------------
> > 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@...
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
>
> ------------------------------------------------------------------------------
> 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@...
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

 « Return to Thread: New feature in Gambas 3