Re: Fast appending and sorting of alot of short strings
- Posted by Tommy Carlier <tommy.carlier at telenet.be> Oct 10, 2004
- 508 views
I've decided to remove collections from Win4Eu. I implemented collections in the first place, because I thought that it's better to append multiple elements at once than to append element per element. But I just did a little test, and it appears that my collection-code is a lot slower than the default appending 1 element to a sequence. Here's the test-code:
sequence s1, s2 atom t1, t2 s1 = newCollection() t1 = time() for i=1 to 100000 do s1 = addToCollection(s1, i) end for t1 = time() - t1 s2 = {} t2 = time() for i=1 to 100000 do s2 &= i end for t2 = time() - t2 ? {t1, t2}
-- tommy online: http://users.telenet.be/tommycarlier tommy.blog: http://tommycarlier.blogspot.com Euphoria Message Board: http://uboard.proboards32.com Empire for Euphoria: http://empire.iwireweb.com