#604 Allow collections other than array to accept an initial size argument on new.

5.0.0
pending
None
none
1
2016-07-01
2014-07-05
No

The various collection objects will automatically expand as needed as they grow in size. However, this expansion can be fairly inefficient. It would be nice if the programmer could give a hint for the target capacity so that the capacity does not need to be expanded as items are added.

Discussion

  • Rick McGuire

    Rick McGuire - 2014-09-24
    • status: unread --> accepted
    • assigned_to: Rick McGuire
    • Pending work items: none --> doc+test
    • Milestone: None --> 5.0.0
     
  • Erich

    Erich - 2015-07-04
    • Pending work items: doc+test --> tests
     
  • Erich

    Erich - 2015-07-04

    In 5.0 some collection classes have acquired a "size" parameter, some haven't. Here's an overview, which classes' new() methods accept a parameter:

                   4.2 5.0
    Directory        0   1
    StringTable    n/a   0
    Properties       0   1
    Relation         0   0
    Stem             1   1  (name, not size)
    Table            0   0
    IdentityTable    0   1
    Array            1   1  (for each dimension)
    List             0   1
    Queue            0   1
    CircularQueue    1   1
    Bag              0   0
    Set              0   0
    

    Committed doc with revision [r10953]

     

    Related

    Commit: [r10953]

  • Erich

    Erich - 2016-04-12

    Not sure when this happened, but in the current build almost each Collection subclass' new method has acquired a size argument, a hint how large the Collection is expected to grow. The only exception is the Stem class.

    Completed appropriate doc with revision [r11017]

     

    Related

    Commit: [r11017]

  • Erich

    Erich - 2016-07-01
    • status: accepted --> pending
    • Pending work items: tests --> none
     
  • Erich

    Erich - 2016-07-01

    Committed tests with revision [r11082].

     

    Related

    Commit: [r11082]


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks