jed-users mailing list

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

[jed-users] Concatenating arrays


Hi,

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.

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.

Would converting the arrays to lists be worthwhile at all, or
does somebody have some other ideas on how to speed this up?

Thanks,
Morten



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


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