Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!munnari.oz.au!metro!extro!objtch From: objtch@extro.ucc.su.OZ.AU (Peter Goodall) Newsgroups: comp.lang.smalltalk Subject: Re: performance of IdentityDictionary in st80 r4 Message-ID: Date: 17 Jun 91 22:35:39 GMT References: Sender: news@metro.ucc.su.OZ.AU Distribution: comp Organization: Sydney University Computing Service, Sydney, NSW, Australia Lines: 68 Nntp-Posting-Host: extro.ucc.su.oz.au huggins@ticipa.ti.com (Gray Huggins) writes: >Hi, > We have noticed a big difference between populating an IdentityDictionary >with 15000 entries and one with 30000 entries. > - Why? > - What can be done to improve performance? > - Why do we get "a primitive has failed" when we do really big stuff without > garbage collecting? > Here is our test >1) >| a | >a := IdentityDictionary new. >Time millisecondsToRun: [ > 1 to: 15000 do: [ :i | > a at: DummyClass new put: i]] >Result => 11390 milliseconds >2) >| a | >a := IdentityDictionary new. >Time millisecondsToRun: [ > 1 to: 30000 do: [ :i | > a at: DummyClass new put: i]] >Result => 1049351 milliseconds >Regards, >-- >Gray Huggins Internet: huggins@ticipa.csc.ti.com >Texas Instruments >PO Box 655012 M/S 3635 TI MSG: GHUG >Dallas, TX 75265 Voice: (214) 917-2202 Greetings, As another reply suggested the problem is probably in the hash table used to store the objects. I had a problem on a client site with Smalltalk/286. I told them that it appeared that their perfomance was being eaten in SymbolTable hashing. Often, if you don't have a profiler, you can see what the system is doing by creating a user-break in the system and looking at the Smalltalk stack. If you see the same method sequence a lot, that's likely where the time is going. I eventually built an interrupt-driven profiler to prove a few points. We looked at rewriting the hashing function, but after a little experimentation, I changed the load-factor in the hash-tables from the 85% or so to 55% - and the system increased its speed by about 40%. I did lots of tests to measure the number of collisions in the has function and found it was horrific with about 7000 symbols, which was thereal size of the SymbolTable. I notice that Digitalk has dropped the loading to about 50% in Smalltalk/V WIndows. Advice: Beg borrow or buy a profiling system, and read Knuth on hash functions. Bye, -- Peter Goodall - Smalltalk Systems Consultant - objtch@extro.ucc.su.oz.au ObjecTech Pty. Ltd. - Software Tools, Training, and Advice 162 Burns Bay Rd, LANE COVE, NSW, AUSTRALIA. - Phone/Fax: +61 2 418-7433