Re: optimization question

2004-02-23 Thread ajb
G'day all. Quoting Peter Simons <[EMAIL PROTECTED]>: > If you don't mind using FFI, the tool of choice would > probably be . Perfect hash functions are actually not that much better than "imperfect" hash functions for the case where you have keys to search for

RE: optimization question

2004-02-23 Thread ajb
G'day. Quoting Hal Daume III <[EMAIL PROTECTED]>: > Finally, I implemented a version which reads data into a finitemap. I'd be curious about the relative performance in using a ternary search trie: http://cvs.sourceforge.net/viewcvs.py/hfl/hfl/edison/Assoc/ Cheers, Andrew Bromage _

Re: optimization question

2004-02-23 Thread Peter Simons
Max Kirillov writes: >> [...] I will generate large case statements like the >> first form and want to know if I should bother >> pre-optimizing it to the second. > I suppose such things should be made by flex-style > generators. If you don't mind using FFI, the tool of choice would probab

RE: optimization question

2004-02-23 Thread Hal Daume III
more > than one string in the list, otherwise use an equality test > > That would not be hard to do. If it becomes important to you, I'd have > a go. But before doing so, could you do the work by hand and see if it > makes a useful performance difference? > >

Re: optimization question

2004-02-23 Thread Lennart Augustsson
Simon Peyton-Jones wrote: generate case expressions when there is more than one string in the list, otherwise use an equality test Oh, you mean like hbc does? ;-) Sorry, couldn't resist. -- Lennart ___ Glasgow-haskell-users mailing list

Re: optimization question

2004-02-23 Thread Max Kirillov
On Sun, Feb 22, 2004 at 12:20:35AM -0800, John Meacham wrote: > case x of > "foo" -> Foo > "bar" -> Bar > "fuzz" -> Fuzz > "fuzo" -> Fuzo > x -> other .. thing > The reason I ask is I am writing someting which will generate large case > statements like the

RE: optimization question

2004-02-23 Thread Simon Peyton-Jones
ruary 2004 15:32 | To: John Meacham | Cc: [EMAIL PROTECTED] | Subject: Re: optimization question | | John Meacham wrote: | > I was wondering if: | > | > case x of | > "foo" -> Foo | > "bar" -> Bar | > "fuzz" -> Fuzz | &

Re: optimization question

2004-02-22 Thread Sven Panne
John Meacham wrote: I was wondering if: case x of "foo" -> Foo "bar" -> Bar "fuzz" -> Fuzz "fuzo" -> Fuzo x -> other .. thing would optimize to let z = other .. thing in case x of ('f':x) -> case x of ('u':'z': x) ->

Re: optimization question

2004-02-22 Thread Ketil Malde
John Meacham <[EMAIL PROTECTED]> writes: > The reason I ask is I am writing someting which will generate large case > statements [over strings] and want to know if I should bother > pre-optimizing it to [search tries]ยน I've no idea what compilers do, but one quick-and-dirty way to optimize this c

optimization question

2004-02-22 Thread John Meacham
I was wondering if: case x of "foo" -> Foo "bar" -> Bar "fuzz" -> Fuzz "fuzo" -> Fuzo x -> other .. thing would optimize to let z = other .. thing in case x of ('f':x) -> case x of ('u':'z': x) -> "z" -> F