Re: Fast appending and sorting of alot of short strings

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu