Re: [Pharo-users] Dictionary removeKey: very low performance

2020-02-11 Thread Richard O'Keefe
My Dictionary and Set implementations (neither of which inherits from the other) grow but do not shrink. It's easy enough to do, I just have not bothered because I have a significant redesign that improves space and time that needs finishing. I've used the marking-deleted-entries technique in the

Re: [Pharo-users] Dictionary removeKey: very low performance

2020-02-10 Thread Kasper Østerbye
Hi RIchard, On 9 February 2020 at 17.54.30, Richard O'Keefe (rao...@gmail.com) wrote: My library uses separate chaining (https://en.wikipedia.org/wiki/Hash_table#Separate_chaining) which makes deletion simple and fast and allows 'null' keys. Does your implementation use a fixed number of buckets

Re: [Pharo-users] Dictionary removeKey: very low

2020-02-09 Thread Richard O'Keefe
It's a problem with the traditional Smalltalk-80 implementation of Dictionaries. Using my compiler and library, 1311 usec to build 498 usec to delete (1..1) 1318 usec to build 472 usec to delete (1..1) (The time difference between building and deleting is mostly #printString.) There is no

Re: [Pharo-users] Dictionary removeKey: very low

2020-02-07 Thread Kasper Østerbye
! I need to test it with real datas, to be continued. Thanks for all. Pierre *De :* Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] *De la part de* PBKResearch *Envoyé :* lundi 3 février 2020 12:25 *À :* 'Any question about pharo is welcome' *Objet :* Re: [Pharo-users]

Re: [Pharo-users] Dictionary removeKey: very low

2020-02-07 Thread LABORDE Pierre
un...@lists.pharo.org] De la part de PBKResearch Envoyé : lundi 3 février 2020 12:25 À : 'Any question about pharo is welcome' Objet : Re: [Pharo-users] Dictionary removeKey: very low Pierre It’s all to do with rehashing. A dictionary is stored as an Array of Association. After a key a

Re: [Pharo-users] Dictionary removeKey: very low

2020-02-03 Thread PBKResearch
: [Pharo-users] Dictionary removeKey: very low Hi all, I have a problem with Dictionaries : dic := Dictionary new: 1. 1 to: 1 do:[ :i | dic at: i put: i printString. ]. 1 to: 1 do:[ :i | dic removeKey: i. ] Removing each keys is

[Pharo-users] Dictionary removeKey: very low

2020-02-03 Thread LABORDE Pierre
Hi all, I have a problem with Dictionaries : dic := Dictionary new: 1. 1 to: 1 do:[ :i | dic at: i put: i printString. ]. 1 to: 1 do:[ :i | dic removeKey: i. ] Removing each keys is very slooow, time execution difference between add and remove is crazy. Any