System.Collections Memory and Speed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    #1

    System.Collections Memory and Speed

    What type of collection and what datatypes would be most efficient for
    storing the following data considering both memory and speed?
    Is there a formula to calculate the memory usage and estimate the speed?

    When a file such as an image is referenced in the app I want to have a
    collection of attributes of the image such as width and height, and even the
    extension of the file if I choose to make the reference to the file and
    integer as shown in the second example below. Average number of items in
    the hashtable will be less than 5000 but could be 20 to 50 thousand in some
    circumstances.

    In this example you could lookup the path to a file and find the width and
    height:
    Key = Path to an image ( string length 20-30 characters )
    Value = Width and Height ( Could be stored as a struct, string, class
    reference or any better suggestion )

    OR

    In this example you could just pass a file number like10256 and get the
    width, height and extension
    Key = Integer representing the file
    Value = Width, Height and Extension ( Could be stored as a struct, string,
    class reference or any better suggestion and in the case of non image files
    the width and height on a struct could be set to null/0 depending on the
    value type used )

    Thanks,

    Mike


Working...