jed-users mailing list

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

Re: [jed-users] Concatenating arrays


Morten Bo Johansen <mbj@xxxxxxxxx> wrote:
> Concatenating arrays can be quite slow. In casu, I want to
> concatenate arrays with file contents obtained with fgetslines
> () - which returns the file as an array of lines. I wonder if
> converting these arrays to lists and then concatenate them
> would be more efficient?
>
> But if so, I am looking for an "array_to_list" function. There is
> one such function in datutils.sl on jedmodes, but it fails with
> a buffer overflow error.

My feeling is that array_to_list would result in a performace hit that
would defeat the purpose of using it.

> To describe my problem in detail, then I want to hash a
> spellchecking wordlist of ~500.000 words, each on a line by
> themselves, to complete from but also include other files to
> complete from, e.g. in markup modes. Obtaining the array (a) of
> the 500.000 lines with fgetslines and hashing them takes about
> 1.5 seconds, but if I add just a tiny array (b) to (a) like in
> c = [a, b], then the execution time more than doubles.

How do you intend to use the result?  For example, could your code use
a list of arrays?  That is, instead of c = [a, b], could you code use
c = {a, b}, which is a list of 2 arrays?

Thanks,
--John


_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


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