jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: API


On Sun, Jul 13, 2003 at 03:36:33PM +0000, Joerg Sommer wrote:
> I don't know if slang supports inline-ing, otherwise all these functions
> wastes time and space, because (correct me if I'm wrong) a direct call of
> up(1) is faster then up_1().
Try this.

tic();
define test()
{
  tic();
  go_up_1;
  go_down_1; 
  % repeat a 1000 times
  vmessage("%S", toc());  
}
vmessage("%S", toc());

M-x evalbuffer

Takes 0.06 seconds.

M-x test

Takes  0.02 seconds.


tic();
define test()
{
  tic();
  ()=up(1);
  () = down(1); 
  % repeat a 1000 times
  vmessage("%S", toc());  
}
vmessage("%S", toc());

M-x evalbuffer

Takes 0.15 seconds

M-x test

Takes 0.01 seconds

So go_up_1 takes twice as long to execute, but 0.4 as long to load. Since
loading takes 3-15 times as long as executing, go_up_1 may be faster. You
have to run test() 9 times before ()=up(1) starts winning.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]