Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance of the Darwin 6.6 Libc malloc()



Am Samstag, 28.06.03 um 10:16 Uhr schrieb Christopher Sean Morrison:

Date: Sat, 28 Jun 2003 02:47:22 +0200
Subject: Re: Performance of the Darwin 6.6 Libc malloc()
From: Nat! <email@hidden>
To: email@hidden

are these graphs supposed to mean, that the more memory is allocated,
the faster the allocation happens ? That'd be one funny malloc. Also
how come the allocation unit size is something like between 100000
bytes and 7e+07, ain't that enormous allocation units ? That doesn't
sound right to me. If its right, who cares how fast that is ? You
usually allocate that big blocks once or twice during the lifetime of
the program. :)

The graph is not Time vs. Size, as your first question implies. Vertical
value is a rate. The data to compute a Time vs. Size graph is provided in
the Logs should that be an interest.

Well mallocs/s is a rate, the number of mallocs made per second. But if you read the graph (f.e. Test-Darwin-Linux-IRIX-65536-1048576-Real) it says, in pseudocode

for( i = 0; i < 20000; i++)
malloc( 100000);

runs in a second but it also says

for( i = 0; i < 100000; i++)
malloc( 1000000);

runs in a second too. That does not make sense.


The graph shows that as the allocation size increases, the rate of memory
allocation increases. For a "normal" malloc implementation, we might
expect a performance curve to be rather flat; allocating in chuncks twice
as large should cause a rate increase of approximately 2x. Both of the
linux curves are very close to that shape.

I see so maybe you want your allocation rate to be labeled something like GB /s rather ?

Examples might include window managers, 2d
graphics app, 3d modeling/rendering apps, simluations, etc. I would
conceed, though, that larger allocation sizes are perhaps not common in a
majority of applications and application domains.

The time used to actually use that kind of memory (f.e. memcpy( dst, src, 100000)) dwarfs the time that the allocation spends. So it is uninteresting.

Ciao
Nat!
------------------------------------------------------
You know, in the Bible it doesn't say,
"Waddle forth and calcify." -- DLR
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Performance of the Darwin 6.6 Libc malloc() (From: Christopher Sean Morrison <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.