[REBOL] Re: Multi-process
From: greggirwin:mindspring at: 1-Nov-2002 16:39
Hi Louis,
The first thing that jumped out at me was this:
foreach line lines [
write/append %i-8.txt join line newline
]
When you do a write/append (someone correct me if I'm wrong), REBOL is going
to open the file, seek to the end, write the data, and close the file for
every line you write. This is very inefficient, and likely the cause of the
slowdown. Depending on how long your lines are, it could be doing that a
couple hundred thousand times for an 8 meg file.
Have you tried just using write/lines? E.g.
>> b: [{1 lksjdflksdjf} {2 lksjdflksdjfl} {3 lskjdflksdj}]
== ["1 lksjdflksdjf" "2 lksjdflksdjfl" "3 lskjdflksdj"]
>> write/lines %test.txt b
results in this:
1 lksjdflksdjf
2 lksjdflksdjfl
3 lskjdflksdj
--Gregg