Re: Associative Arrays need cleanout method or property to help

2010-03-24 Thread Michael Rynn
so I don't see where the linear congruent random probe thingy is g. You *could* get rid of the left and right pointers and use linear congruent probing, and that might be worth a try. Thank you for the suggestion , I will give it a try. --- Michael Rynn

Re: Associative Arrays need cleanout method or property to help

2010-03-23 Thread Michael Rynn
On Mon, 22 Mar 2010 00:52:24 -0700, Walter Bright wrote: bearophile wrote: A way to know the usage patterns of D AAs is to add instrumentation in nonrelease mode, they can save few statistical data once in a while in the install directory of D, and then the user can give this little txt file

Re: Associative Arrays need cleanout method or property to help

2010-03-23 Thread Michael Rynn
On Tue, 23 Mar 2010 13:41:56 -0700, Walter Bright wrote: Michael Rynn wrote: On Mon, 22 Mar 2010 00:52:24 -0700, Walter Bright wrote: bearophile wrote: A way to know the usage patterns of D AAs is to add instrumentation in nonrelease mode, they can save few statistical data once in a

Re: Associative Arrays need cleanout method or property to help

2010-03-23 Thread Walter Bright
Michael Rynn wrote: I do not think this is true of current builtin AA, Correct, it is not. and therefore not true of this enhanced implementation. I note the current builtin _aaGet will locate a new node by pointer, maybe do a rehash, and then return the node it previously relocated.

Re: Associative Arrays need cleanout method or property to help

2010-03-22 Thread Walter Bright
bearophile wrote: A way to know the usage patterns of D AAs is to add instrumentation in nonrelease mode, they can save few statistical data once in a while in the install directory of D, and then the user can give this little txt file to Walter to tune the language :-) There's no need to tune

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-20 Thread Moritz Warning
On Wed, 17 Mar 2010 03:07:57 +, Michael Rynn wrote: On Tue, 16 Mar 2010 16:12:25 +, Moritz Warning wrote: On Tue, 16 Mar 2010 04:41:55 +, Michael Rynn wrote: [..] But do not take this very restricted and rather extreme sampling of possible test parameters to be a reliable

Re: Associative Arrays need cleanout method or property to help

2010-03-20 Thread bearophile
Moritz Warning: The Python docs say that common usage is mostly about very small aas with frequent accesses but rare changes. D and Python will probably have different usage patterns for AAs. In Python dicts (AAs) are used to give arguments to functions (that's why recursive functions are so

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-20 Thread Robert Jacques
On Wed, 17 Mar 2010 02:57:34 -0300, Michael Rynn michaelr...@optusnet.com.au wrote: [snip] I want to add that the problems of AA with garbage collection are not particular to the implementation of built-in AA. The number of nodes that builtin AA creates will increase GC scanning, but the AA

Re: Associative Arrays need cleanout method or property to help

2010-03-20 Thread Rainer Deyke
On 3/20/2010 13:21, bearophile wrote: Moritz Warning: The Python docs say that common usage is mostly about very small aas with frequent accesses but rare changes. D and Python will probably have different usage patterns for AAs. In Python dicts (AAs) are used to give arguments to functions

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-17 Thread Michael Rynn
On Tue, 16 Mar 2010 16:12:25 +, Moritz Warning wrote: On Tue, 16 Mar 2010 04:41:55 +, Michael Rynn wrote: The use of built in Associative Array can have deleterious effects on Garbage Collection. :( Fwiw, here is the original Python Dictionary implementation:

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-16 Thread dsimcha
I've been arguing for a long time that the interaction between conservative GC w/o thread-local allocators and the builtin AA is horrible. Keep this in mind: You have to take the GC lock for **EVERY SINGLE INSERTION** into a builtin AA. This makes them absolutely worthless in multithreaded

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-16 Thread Moritz Warning
On Tue, 16 Mar 2010 04:41:55 +, Michael Rynn wrote: The use of built in Associative Array can have deleterious effects on Garbage Collection. :( Fwiw, here is the original Python Dictionary implementation: http://svn.python.org/projects/python/trunk/Objects/dictobject.c This is also a

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-16 Thread Michael Rynn
On Tue, 16 Mar 2010 16:12:25 +, Moritz Warning wrote: On Tue, 16 Mar 2010 04:41:55 +, Michael Rynn wrote: The use of built in Associative Array can have deleterious effects on Garbage Collection. :( Fwiw, here is the original Python Dictionary implementation:

Associative Arrays need cleanout method or property to help garbage collection

2010-03-15 Thread Michael Rynn
The use of built in Associative Array can have deleterious effects on Garbage Collection. D by default uses garbage collection for memory management. This means that any blocks of memory that contain random bits can be mistaken as containing pointers to valid data, and can prevent complete