Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-25 Thread Eli Barzilay
10 hours ago, Matthew Flatt wrote: At Sun, 24 Apr 2011 20:53:22 -0400, Eli Barzilay wrote: 10 hours ago, Matthew Flatt wrote: I've pushed the change that makes `assoc', `assv', and `assq' implemented in Racket, including the new optional argument for `assoc'. [...] Also, what

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-25 Thread Eli Barzilay
10 hours ago, Robby Findler wrote: On Sun, Apr 24, 2011 at 8:06 PM, Eli Barzilay e...@barzilay.org wrote: I don't think that there would be a locality issue -- you never dereference the slow pointer. I thought the way it worked was you had two pointers into the list and you did cdr on

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Matthew Flatt
I've pushed the change that makes `assoc', `assv', and `assq' implemented in Racket, including the new optional argument for `assoc'. At Fri, 22 Apr 2011 19:52:34 -0400, Eli Barzilay wrote: 7 minutes ago, Matthew Flatt wrote: Switching to a Racket implementation costs time, but (with the

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Matthew Flatt
At Sun, 24 Apr 2011 10:52:34 -0400, Sam Tobin-Hochstadt wrote: On Sun, Apr 24, 2011 at 10:44 AM, Matthew Flatt mfl...@cs.utah.edu wrote: For those who are *really* interested, I've included annotated, disassembled JIT output at the end of this message. Did you use my disassembler for

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Neil Van Dyke
Thanks for the performance numbers and JIT enhancements, Matthew. Do I read this correctly that (for whatever distributions of inputs you used) we can expect the new assq to be about twice as fast on 64-bit x86, and about half-again as slow on 32-bit? Matthew Flatt wrote at 04/24/2011 10:44

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Robby Findler
Why is the turtle on the stack in the gcc version? Robby On Sun, Apr 24, 2011 at 9:44 AM, Matthew Flatt mfl...@cs.utah.edu wrote: I've pushed the change that makes `assoc', `assv', and `assq' implemented in Racket, including the new optional argument for `assoc'. At Fri, 22 Apr 2011 19:52:34

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Matthew Flatt
At Sun, 24 Apr 2011 12:48:53 -0400, Neil Van Dyke wrote: Do I read this correctly that (for whatever distributions of inputs you used) we can expect the new assq to be about twice as fast on 64-bit x86, and about half-again as slow on 32-bit? Well, here are some new numbers (32-bit):

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Matthew Flatt
At Sun, 24 Apr 2011 19:24:18 -0400, Neil Van Dyke wrote: The modest performance hit for assq on 32-bit (my workstation) right now is a small price to pay for doubling the speed on 64-bit (lots of servers). I forgot to reply to that point before. Unfortunately, I don't think you're going to

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Robby Findler
Those different oses only or different hardware too? Robby On Sunday, April 24, 2011, Matthew Flatt mfl...@cs.utah.edu wrote: At Sun, 24 Apr 2011 19:24:18 -0400, Neil Van Dyke wrote: The modest performance hit for assq on 32-bit (my workstation) right now is a small price to pay for doubling

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Eli Barzilay
10 hours ago, Matthew Flatt wrote: I've pushed the change that makes `assoc', `assv', and `assq' implemented in Racket, including the new optional argument for `assoc'. Thanks! That, and the other improvement, sounds really good. (I'm excited enough about this that I'm running the third

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Robby Findler
On Sun, Apr 24, 2011 at 7:53 PM, Eli Barzilay e...@barzilay.org wrote: Here's another idea: in a world of immutable lists there are *much* less circular lists.  (Even more: the fact that they're generated via a temporary structure that is then copied means that they're usually very short too.)

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Robby Findler
On Sun, Apr 24, 2011 at 8:00 PM, Eli Barzilay e...@barzilay.org wrote: About a minute ago, Robby Findler wrote: On Sun, Apr 24, 2011 at 7:53 PM, Eli Barzilay e...@barzilay.org wrote: Here's another idea: in a world of immutable lists there are *much* less circular lists.  (Even more: the

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Eli Barzilay
About a minute ago, Robby Findler wrote: On Sun, Apr 24, 2011 at 8:00 PM, Eli Barzilay e...@barzilay.org wrote: About a minute ago, Robby Findler wrote: On Sun, Apr 24, 2011 at 7:53 PM, Eli Barzilay e...@barzilay.org wrote: Here's another idea: in a world of immutable lists there are

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Matthew Flatt
Different hardware. At Sun, 24 Apr 2011 19:02:33 -0500, Robby Findler wrote: Those different oses only or different hardware too? Robby On Sunday, April 24, 2011, Matthew Flatt mfl...@cs.utah.edu wrote: At Sun, 24 Apr 2011 19:24:18 -0400, Neil Van Dyke wrote: The modest performance hit

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Matthew Flatt
I don't think the current cycle-checking cost is significant. Also, if a program uses `assoc' on a list that's long enough for locality of the turtle to matter, then it probably has bigger problems. But don't let me stop you from experimenting! At Sun, 24 Apr 2011 20:07:31 -0500, Robby Findler

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Matthew Flatt
At Sun, 24 Apr 2011 20:53:22 -0400, Eli Barzilay wrote: 10 hours ago, Matthew Flatt wrote: I've pushed the change that makes `assoc', `assv', and `assq' implemented in Racket, including the new optional argument for `assoc'. [...] Also, what about `member'? I almost moved that one,

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Neil Van Dyke
Eli Barzilay wrote at 04/24/2011 09:01 PM: Related to the other thing I said: if you have code that depends on fast assoc-ing, and you don't have cycles, then rolling your own version is probably going to be faster anyway. Good point. I believe this was not case when I was profiling

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-24 Thread Robby Findler
On Sun, Apr 24, 2011 at 8:19 PM, Matthew Flatt mfl...@cs.utah.edu wrote: I don't think the current cycle-checking cost is significant. Also, if a program uses `assoc' on a list that's long enough for locality of the turtle to matter, then it probably has bigger problems. But don't let me stop

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-23 Thread Eli Barzilay
9 hours ago, Noel Welsh wrote: On Sat, Apr 23, 2011 at 12:52 AM, Eli Barzilay e...@barzilay.org wrote: Is there some obvious reason for the huge difference in improvement between the 32 and the 64 bits (Almost twice slower and roughly the same resp.)? My guess is that this benchmark is

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-22 Thread Matthew Flatt
I would like to look closely at this. Can you send me a patch? At Fri, 22 Apr 2011 16:26:42 -0400, Vincent St-Amour wrote: Currently, unlike remove and remove-duplicates, assoc and member cannot use a user-provided equality check. I have a patch that fixes that by adding an optional argument

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-22 Thread Vincent St-Amour
At Fri, 22 Apr 2011 14:34:16 -0600, Matthew Flatt wrote: I would like to look closely at this. Can you send me a patch? Sure, I'll tidy it up and send it to you. Vincent _ For list-related administrative tasks:

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-22 Thread Vincent St-Amour
Good idea. I'll look into that. Vincent At Fri, 22 Apr 2011 17:09:51 -0400, Eli Barzilay wrote: 40 minutes ago, Vincent St-Amour wrote: With this patch, assoc and member are implemented in Racket. They are currently implemented in C. I haven't measured the performance impact of the

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-22 Thread Neil Van Dyke
Vincent St-Amour wrote at 04/22/2011 04:26 PM: With this patch, assoc and member are implemented in Racket. They are currently implemented in C. I haven't measured the performance impact of the change, but I can do it if someone believes it's necessary. Testing performance impact of

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-22 Thread Matthew Flatt
Here's a performance experiment (code enclosed). Functions: assq2 = plain Racket implementation of `assq' assq-via-assf = `assq' via `assf' in same module assq-via-library-assf = `assq' via imported `assf' assoc2 = plain Racket implementation of `assoc' assoc2/opt = like `assoc2', but

Re: [racket-dev] Optional equality predicate for assoc and member

2011-04-22 Thread Robby Findler
What are the non-JIT platforms nowadays? Robby On Fri, Apr 22, 2011 at 6:39 PM, Matthew Flatt mfl...@cs.utah.edu wrote: Here's a performance experiment (code enclosed). Functions:  assq2 = plain Racket implementation of `assq'  assq-via-assf = `assq' via `assf' in same module