Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!jhunix!barrett From: barrett@jhunix.HCF.JHU.EDU (Dan Barrett) Newsgroups: comp.sys.amiga.programmer Subject: How fast/slow is memory DEallocation? Message-ID: <8504@jhunix.HCF.JHU.EDU> Date: 31 May 91 03:48:39 GMT Organization: The Johns Hopkins University - HCF Lines: 30 I wrote a program that uses a LARGE data structure with thousands of pointers, and I'm now porting it to my Amiga 1000 (stock 68000). I have noticed that my data structure is being deallocated extremely slowly --- almost excruciatingly so. The structure is a binary search tree in which every node contains three linked lists and ANOTHER binary search tree (which contains 3 lists and another tree, etc, recursively to any level). When the structure has a thousand nodes or so, and I deallocate it, it takes several minutes! Building the structure took much less time, and there was more computation going on then! At first, I thought the problem might be Manx's malloc()/free() functions, so I switched to AllocMem/FreeMem. This sped things up a bit, but not much. I have a feeling that this is a system-dependent issue and not an error in my code. The program already runs on 3 other CPU's, and deallocation is lightning fast. I am using Manx 5.0d. Any suggestions? Dan //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | Dan Barrett, Department of Computer Science Johns Hopkins University | | INTERNET: barrett@cs.jhu.edu | | | COMPUSERVE: >internet:barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////