Re: VC STL performance (learning the right approach for the right job)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I know vc stl sometimes slow than stlport,but i still use vc stl

It is fairly impossible for vendors to 2nd guess what programmers will do.
They have to provide a std container that for _most circumstances_ is
generally satisfactory.

For example with std::list, if you delete an element, does the allocator
save the old memory for next use (pooling it) or does it immediately free
the memory? Saving the nodes memory for next use will increase performance
but at the cost of hoarding memory. Neither choice is necessary the "right"
choice by the vendor.
There will always be situation where it is _specifically_ poor for the
programmers circumstances.

Providing alternative allocators goes someway to alleviating this.

Personally I wish the C++ standard had specified that all containers had a
compact() member function which guaranteed any surplus not-in-use-memory the
container was using was deallocated. The vendor could then freely recycle
memory knowing that the programmer could call this member fuinction if need
be.

Stephen Howe


.



Relevant Pages

  • Re: GNAT for MS Visual Studio
    ... What if there is *not* enough memory? ... I have a data structure that ... A container of use cases will be needed to store them. ... If there are no containers to do the job, then programmers will ...
    (comp.lang.ada)
  • bus_dmamem_alloc failed to align memory properly
    ... usable memory = 4279500800 ... vendor = 'Nvidia Corp' ... subclass = RAM ...
    (freebsd-stable)
  • [-mm PATCH 10/10] Memory controller add documentation
    ... Differentiate between RSS and Page Cache - Paul Menage ... The infrastructure allows easy addition of other types of memory to control ... +c. Provides *zero overhead* for non memory controller users ... a container on hitting a limit, ...
    (Linux-Kernel)
  • Re: Determine calling function
    ... to encourage programmers to escape from following dogma mindlessly. ... ad absurdem of an insistence on checking malloc(), ... I don't know how much memory starting at ... Obviously a *hard* setrlimit() cannot be employed for throttling ...
    (comp.lang.c)
  • Re: [ckrm-tech] [patch00/05]: Containers(V2)- Introduction
    ... I finally looked into your memory controller patches. ... Current cpuset feature in Linux kernel ... We use the term container to indicate a structure against which we track ... changes in kernel are minimized so as this support can ...
    (Linux-Kernel)