Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > free() performance question

Reply
Thread Tools

free() performance question

 
 
Barry
Guest
Posts: n/a
 
      06-28-2007

"CBFalconer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Lianjun Jiang wrote:
>>
>> In my code, I need to concat two buffer into one. I take following
>> steps:
>> 1 malloc a new space
>> 2 copy two buffers over,
>> 3. and then free the originial two buffers.
>> I put timer on each step. And I found that under some stress
>> condition(cpu intensive, lots of memory used), the last step took
>> a lot more time than step 1 and 2. Did anyone know what could be
>> the reason?

>
> Yes. It usually depends on the number of malloced pieces in effect
> at the time and the effort required to detect and join them. I
> wrote nmalloc to avoid it (and a few other problems). See:
>
> <http://cbfalconer.home.att.net/download/>
>
> for an (almost) standard C implementation for DJGPP and others.
>


Although in most cases I agree with you, how do you find an
almost because I wrote it, appropriate for clc?


 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      06-28-2007
Barry wrote:
> "CBFalconer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Lianjun Jiang wrote:
>>> In my code, I need to concat two buffer into one. I take following
>>> steps:
>>> 1 malloc a new space
>>> 2 copy two buffers over,
>>> 3. and then free the originial two buffers.
>>> I put timer on each step. And I found that under some stress
>>> condition(cpu intensive, lots of memory used), the last step took
>>> a lot more time than step 1 and 2. Did anyone know what could be
>>> the reason?

>> Yes. It usually depends on the number of malloced pieces in effect
>> at the time and the effort required to detect and join them. I
>> wrote nmalloc to avoid it (and a few other problems). See:
>>
>> <http://cbfalconer.home.att.net/download/>
>>
>> for an (almost) standard C implementation for DJGPP and others.
>>

>
> Although in most cases I agree with you, how do you find an
> almost because I wrote it, appropriate for clc?
>
>


Can you explain what's wrong with the message?
Or you think it is forbidden to speak about what one's writes
in this newsgroup?

jacob
 
Reply With Quote
 
 
 
 
Barry
Guest
Posts: n/a
 
      06-28-2007

"jacob navia" <(E-Mail Removed)> wrote in message
news:46833ba4$0$5083$(E-Mail Removed)...
> Barry wrote:
>> "CBFalconer" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Lianjun Jiang wrote:
>>>> In my code, I need to concat two buffer into one. I take following
>>>> steps:
>>>> 1 malloc a new space
>>>> 2 copy two buffers over,
>>>> 3. and then free the originial two buffers.
>>>> I put timer on each step. And I found that under some stress
>>>> condition(cpu intensive, lots of memory used), the last step took
>>>> a lot more time than step 1 and 2. Did anyone know what could be
>>>> the reason?
>>> Yes. It usually depends on the number of malloced pieces in effect
>>> at the time and the effort required to detect and join them. I
>>> wrote nmalloc to avoid it (and a few other problems). See:
>>>
>>> <http://cbfalconer.home.att.net/download/>
>>>
>>> for an (almost) standard C implementation for DJGPP and others.
>>>

>>
>> Although in most cases I agree with you, how do you find an
>> almost because I wrote it, appropriate for clc?

>
> Can you explain what's wrong with the message?
> Or you think it is forbidden to speak about what one's writes
> in this newsgroup?
>
> jacob


I wrote my response in simple English. What part confuses you?


 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      06-28-2007
Barry wrote:
> "jacob navia" <(E-Mail Removed)> wrote in message
> news:46833ba4$0$5083$(E-Mail Removed)...
>> Barry wrote:
>>> "CBFalconer" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Lianjun Jiang wrote:
>>>>> In my code, I need to concat two buffer into one. I take following
>>>>> steps:
>>>>> 1 malloc a new space
>>>>> 2 copy two buffers over,
>>>>> 3. and then free the originial two buffers.
>>>>> I put timer on each step. And I found that under some stress
>>>>> condition(cpu intensive, lots of memory used), the last step took
>>>>> a lot more time than step 1 and 2. Did anyone know what could be
>>>>> the reason?
>>>> Yes. It usually depends on the number of malloced pieces in effect
>>>> at the time and the effort required to detect and join them. I
>>>> wrote nmalloc to avoid it (and a few other problems). See:
>>>>
>>>> <http://cbfalconer.home.att.net/download/>
>>>>
>>>> for an (almost) standard C implementation for DJGPP and others.
>>>>
>>> Although in most cases I agree with you, how do you find an
>>> almost because I wrote it, appropriate for clc?

>> Can you explain what's wrong with the message?
>> Or you think it is forbidden to speak about what one's writes
>> in this newsgroup?
>>
>> jacob

>
> I wrote my response in simple English. What part confuses you?
>
>


You wrote:

"Although in most cases I agree with you, how do you find an
almost because I wrote it, appropriate for clc?"

Parse error. "How do you find an almost" ???
Something is missing I would say.
 
Reply With Quote
 
Barry
Guest
Posts: n/a
 
      06-28-2007

"jacob navia" <(E-Mail Removed)> wrote in message
news:4683ad05$0$25952$(E-Mail Removed)...
> Barry wrote:
>> "jacob navia" <(E-Mail Removed)> wrote in message
>> news:46833ba4$0$5083$(E-Mail Removed)...
>>> Barry wrote:
>>>> "CBFalconer" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> Lianjun Jiang wrote:
>>>>>> In my code, I need to concat two buffer into one. I take following
>>>>>> steps:
>>>>>> 1 malloc a new space
>>>>>> 2 copy two buffers over,
>>>>>> 3. and then free the originial two buffers.
>>>>>> I put timer on each step. And I found that under some stress
>>>>>> condition(cpu intensive, lots of memory used), the last step took
>>>>>> a lot more time than step 1 and 2. Did anyone know what could be
>>>>>> the reason?
>>>>> Yes. It usually depends on the number of malloced pieces in effect
>>>>> at the time and the effort required to detect and join them. I
>>>>> wrote nmalloc to avoid it (and a few other problems). See:
>>>>>
>>>>> <http://cbfalconer.home.att.net/download/>
>>>>>
>>>>> for an (almost) standard C implementation for DJGPP and others.
>>>>>
>>>> Although in most cases I agree with you, how do you find an
>>>> almost because I wrote it, appropriate for clc?
>>> Can you explain what's wrong with the message?
>>> Or you think it is forbidden to speak about what one's writes
>>> in this newsgroup?
>>>
>>> jacob

>>
>> I wrote my response in simple English. What part confuses you?

>
> You wrote:
>
> "Although in most cases I agree with you, how do you find an
> almost because I wrote it, appropriate for clc?"
>
> Parse error. "How do you find an almost" ???
> Something is missing I would say.


"How do you find an almost," is not what it says. Had I written:
How do you find a purple polka dot elephant in a bowl of cherries?
Would you ask how do you find a purple?


 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      06-28-2007
In article <(E-Mail Removed)>,
Barry <(E-Mail Removed)> wrote:

>>> I wrote my response in simple English. What part confuses you?


>> You wrote:
>>
>> "Although in most cases I agree with you, how do you find an
>> almost because I wrote it, appropriate for clc?"
>>
>> Parse error. "How do you find an almost" ???
>> Something is missing I would say.


>"How do you find an almost," is not what it says. Had I written:
>How do you find a purple polka dot elephant in a bowl of cherries?
>Would you ask how do you find a purple?


I'm a native speaker of English, and I can't make any sense of your
sentence.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
 
Reply With Quote
 
Richard Bos
Guest
Posts: n/a
 
      06-28-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) (Richard Tobin) wrote:

> In article <(E-Mail Removed)>,
> Barry <(E-Mail Removed)> wrote:
>
> >>> I wrote my response in simple English. What part confuses you?

>
> >> You wrote:
> >>
> >> "Although in most cases I agree with you, how do you find an
> >> almost because I wrote it, appropriate for clc?"
> >>
> >> Parse error. "How do you find an almost" ???
> >> Something is missing I would say.

>
> >"How do you find an almost," is not what it says. Had I written:
> >How do you find a purple polka dot elephant in a bowl of cherries?
> >Would you ask how do you find a purple?

>
> I'm a native speaker of English, and I can't make any sense of your
> sentence.


I'm not a native speaker of English, and I find that sentence completely
understandable provided it is not ripped cruelly out of context.

Richard
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      06-28-2007
Barry wrote:
> "CBFalconer" <(E-Mail Removed)> wrote in message
>

.... snip ...
>>
>> Yes. It usually depends on the number of malloced pieces in effect
>> at the time and the effort required to detect and join them. I
>> wrote nmalloc to avoid it (and a few other problems). See:
>>
>> <http://cbfalconer.home.att.net/download/>
>>
>> for an (almost) standard C implementation for DJGPP and others.

>
> Although in most cases I agree with you, how do you find an
> almost because I wrote it, appropriate for clc?


Please attempt to write a fully standard general malloc package.
Can't be done. That is one reason it is part of the
implementation.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      06-28-2007
Richard Tobin wrote:
> Barry <(E-Mail Removed)> wrote:
>
>>>> I wrote my response in simple English. What part confuses you?

>
>>> You wrote:
>>>
>>> "Although in most cases I agree with you, how do you find an
>>> almost because I wrote it, appropriate for clc?"
>>>
>>> Parse error. "How do you find an almost" ???
>>> Something is missing I would say.

>
>> "How do you find an almost," is not what it says. Had I written:
>> How do you find a purple polka dot elephant in a bowl of cherries?
>> Would you ask how do you find a purple?

>
> I'm a native speaker of English, and I can't make any sense of your
> sentence.


I am also (a native speaker), yet I can make sense out of it. It
is an effort, but possible.

BTW someone has been grossly careless in snipping attributions for
quoted material.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Barry
Guest
Posts: n/a
 
      06-28-2007

"CBFalconer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Barry wrote:
>> "CBFalconer" <(E-Mail Removed)> wrote in message
>>

> ... snip ...
>>>
>>> Yes. It usually depends on the number of malloced pieces in effect
>>> at the time and the effort required to detect and join them. I
>>> wrote nmalloc to avoid it (and a few other problems). See:
>>>
>>> <http://cbfalconer.home.att.net/download/>
>>>
>>> for an (almost) standard C implementation for DJGPP and others.

>>
>> Although in most cases I agree with you, how do you find an
>> almost because I wrote it, appropriate for clc?

>
> Please attempt to write a fully standard general malloc package.
> Can't be done. That is one reason it is part of the
> implementation.
>


Chuck, the post was partially in gest because you are typically the
first person to point out off topic posts. I didn't expect it to be a big
deal .


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance Tutorials Services - Boosting Performance by DisablingUnnecessary Services on Windows XP Home Edition Software Engineer Javascript 0 06-10-2011 02:18 AM
Newbie Question: python mysqldb performance question cjl Python 3 05-21-2007 02:49 AM
Performance related Question..... Cris Rock ASP .Net 1 02-12-2004 10:47 AM
Web Form Performance Versus Single File Performance jm ASP .Net 1 12-12-2003 11:14 PM
.NET Performance Question, Please Reply Don Beal ASP .Net 13 09-29-2003 03:46 PM



Advertisments