Results 1 to 3 of 3

Thread: c++ vector = ? delphi

  1. #1

    c++ vector = ? delphi

    hi all

    i am looking for a delphi containers like in c++ ( STL library )
    in experts-exchange they said that Tlist is very slow comparing to c++ vector

  2. #2

    Re: c++ vector = ? delphi

    In Delphi 2009 and 2010 you have the unit Generics.Collections for generic (template) style containers:

    IList : TList<integer>;
    OList : TObjectList<TMyClass>;
    etc.

    In older Delphi you have TList and also TObjectList (in contnrs unit).

    Lists in Delphi are implemented the same as stl Vectors: they are array-based. And since data structure are the same then also performance should be comparable. Sure a good C++ compiler generates faster code than Delphi but you should not notice any big difference.
    ZGameEditor - Develop 64kb games for Windows.
    Thrust for Vectrex - ROM-file and 6809 source code.

  3. #3

    Re: c++ vector = ? delphi

    thnx for the Illustration
    i've done a small test between Tlist and c++ vector

    its an addition of 3000000 records of 16 byte length, in one loop

    Tlist time = 344ms
    Vector time = 339ms

    seems they are the same
    the test use only the function ( List.add , vector.push_back) i don't know how it will be in sorting or other function

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •