- Subject: Re: make_ini and autoload
- From: "G. Milde" <g.milde@xxxxxx>
- Date: Thu, 11 May 2006 10:00:23 +0200
On 10.05.06, John E. Davis wrote:
> Marko Mahnic <marko.mahnic@xxxxxxxx> wrote:
> >To speed things up you can rewrite it as
> >
> > loop(5) { "M:\\jed\\libjmr\\csvutils.sl"; autoload(); }
>
> I think that a cleaner approach would be to use array_map:
>
> array_map (Void_Type, &autoload,
> ["buffer_compress", "spaces2tab", "format_table",
> "goto_max_column", "format_table_rect"],
> "M:\\jed\\libjmr\\csvutils.sl");
This looks promising but is not significantly faster:
"100 times _autoload(10)" 0.007
"1000 times autoload" 0.016
"100 times autoloads" 0.015 "(original version with 10 functions)"
"100 times autoloads2" 0.014 "(speedy version with 10 functions)"
"100 times array_map" 0.013 "(array_map calling 10 autoloads)"
(system time measured with tic() toc(), variations due to system load occure)
The real improvement comes with _autoload().
Thus, ini.sl will continue using the form
"fun", "file";
"fun2", "file";
...
"funN", "file";
_autoload(N);
However, the syntax is inconvenient if you have a bunch of autoloads from
one file. This is no problem with the auto-generated ini.sl but not so
nice in a mode relying on a number of autoloads. Also, the necessity to
explicitely state the number of argument-pairs makes it error-prone in
case the number of needed autoloads changes during the development of a
mode.
So, here is my feature request for an improved autoload():
SYNOPSIS
Load functions from a file
USAGE
autoload(String funct, [String funct2 , ...], String file);
DESCRIPTION
The `autoload' function is used to declare a variable number of
functions `funct' to the interpreter and indicate that they should be
loaded from `file' when actually used.
...
Guenter
--
Milde ife.et.tu-dresden.de
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2006 date index]
[2006 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]