delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/20/11:45:10

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "John" <John DOT Portal AT btinternet DOT com>
Newsgroups: comp.lang.c,comp.os.msdos.djgpp,comp.compilers.lcc
Subject: Re: hash library - interface criticisms
Date: Sun, 20 Jan 2002 16:39:11 -0000
Lines: 29
Message-ID: <a2erq9$10ncrd$1@ID-97861.news.dfncis.de>
References: <3C4ADB8E DOT 552CAE40 AT yahoo DOT com>
NNTP-Posting-Host: host213-122-194-68.btinternet.com (213.122.194.68)
X-Trace: fu-berlin.de 1011544713 34321261 213.122.194.68 (16 [97861])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"CBFalconer" <cbfalconer AT yahoo DOT com> wrote in message
news:3C4ADB8E DOT 552CAE40 AT yahoo DOT com...
> Under VC6 the problem goes away.  I can insert and free 1,000,000
> different items on my machine in under 1 minute, and execution
> time remains linear with item count, i.e. the algorithm is O(n).
> Under gcc or lcc I have never seen the timing for 50,000 items
> freed - I abort it first.
>
> Has anybody any ideas?

Yes I have although it may not help, except to through some light. I also am
currently writing something that allocates many small chunks of memory and
to de-allocate takes much longer than allocating.

Now, here is what I can say. When working with a guy that writes a BASIC
interpreter and compiler I ran into a similar problem, he told me that
malloc & free _do_ can vary depending on how many times one allocates. He
fixed the BASIC, he said, to do it the same way as VC6 and I can tell you it
was comcerderably faster after he fixed it.

He (BASIC guy) did not unfortunately say what VC6 did to speed things along.
Perhaps someone could study the asm output from MSVC and see what is being
done differently.

John



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019