Re: Euphoria's identity/philosophy -- Where is the focus?

new topic     » goto parent     » topic index » view thread      » older message » newer message
Spock said...
_tom said...

The old docs tell you a shell sort is unstable but do not define "stable."

The cure for a better sort algorithm is if you, Spock, could contribute the code you have developed and already tested to the standard library. We would all be grateful.

Spock said...

Another example: The Hash Table in map.e - Although this probably has correctness, it is extremely bloated and has terrible performance. I would consider this implementation to be the HT equivalent of BubbleSort. Of course I've written my own with a much simpler interface and much better performance.

The same goes for alternative Hash algorithms and interface.

_tom

Hi Tom,

When I tested the HT in map.e on an image to try and count the number of unique colors in a bitmap I got a performance difference of some ridiculous factor, in favor of my code. I would have repeated that test right now except.. I can't get map.e to work!

I'll post something later when I can figure it out.. which is the whole point of what I am saying. Why should I have to do extra work to cover someone else's mistake? Whether that's a code lib or programming language, same thing.

Spock

Ok. I am going to make a retraction on the hash table in map.e - the performance is (finally) now not too bad. My original test (see below) was based on the Oct 2012 release. The latest one has corrected the poor algorithm used. However, the interface and unnecessary bloat are still disgusting. The original criticsm was valid, just 2 years too late.

-- Original test 
 
include std/console.e  
include std/map.e  
 
procedure test() 
	atom t 
	t = time() 
	object m = map:new() -- Create a new map 
 
	for i = 1 to 100000 do 
		map:put(m, i, i) 
		map:has(m, i) 
	end for 
 
	? time() - t 
 
	? 9/0 
end procedure 
 
test() 
 
-- map.e 2.5 s 
-- my hash.e .202 s, 12 times faster 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu