struct vs class benchmark (was Re: Give struct the status it
Charles
noone at nowhere.com
Tue Mar 28 06:46:24 PST 2006
> Or if you still want to use classes, you can use an object pool.
>
> Since object pools are a nice paradigm in some instances, I wonder if a
> good standard set of library primitives could be built into phobos?
Good idea , I was wanting this recently too.
David Medlock wrote:
> Ben Phillips wrote:
>
>> Basically what your benchmark (along with Hong's) prove is that
>> classes and
>> structs each have different uses (duh!). Use structs in situations
>> like Hong's
>> case where classes would require a ton of allocation, and use classes in
>> situations like your case where passing by value would induce enormous
>> overhead
>> costs.
>>
>
> Or if you still want to use classes, you can use an object pool.
>
> Since object pools are a nice paradigm in some instances, I wonder if a
> good standard set of library primitives could be built into phobos?
>
> -DavidM
>
>
More information about the Digitalmars-d
mailing list