Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. New MSDN article (flaw?)

New MSDN article (flaw?)

Scheduled Pinned Locked Moved Visual Basic
csharpcssdata-structuresperformance
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ray Cassick
    wrote on last edited by
    #1

    I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph: Object Collections and Object Arrays When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes: * An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. * Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array. * If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection. I am bugged by the first bullet point here... Sounds very wrong to me...

    P D 2 Replies Last reply
    0
    • R Ray Cassick

      I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph: Object Collections and Object Arrays When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes: * An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. * Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array. * If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection. I am bugged by the first bullet point here... Sounds very wrong to me...

      P Offline
      P Offline
      Paul Riley
      wrote on last edited by
      #2

      Ray Cassick wrote: An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. :laugh: Evidently an array is faster either way. I'm thinking the Collection will be faster for random access, but I wouldn't swear to that. Paul

      1 Reply Last reply
      0
      • R Ray Cassick

        I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph: Object Collections and Object Arrays When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes: * An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. * Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array. * If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection. I am bugged by the first bullet point here... Sounds very wrong to me...

        D Offline
        D Offline
        Daniel Turini
        wrote on last edited by
        #3

        Ray Cassick wrote: An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. Correction: Collections are usually implemented using linked lists. Both linked lists and arrays provide fast sequential access. But for random access, arrays are faster. "In an organization, each person rises to the level of his own incompetence." Peter's Principle

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups