perfomance question

Discussion in 'ASP .Net' started by majorone, Aug 10, 2006.

  1. majorone

    majorone Guest

    hello, i am trying to design a method in manipulating data over the
    intranet, and i am wondering which of the following design can get
    better performance.
    can u help me? thanks.


    <<design 1>>
    A DataTable object which contains 4 columns for each row:
    id (int), columnA (string), column B (string), column C (string)


    <<design 2>>
    A generic List<myData> which contains a list of MyData object.

    class MyData{
    int id;
    string columnA;
    string columnB;
    string columnC;
    }
     
    majorone, Aug 10, 2006
    #1
    1. Advertising

  2. Having never tried it, I would guess that using a datatable directly with
    your data would be faster as you wont have any object casting to do.
    Perhaps you should run a small test to find out.

    Regards

    John Timney (MVP)


    "majorone" <> wrote in message
    news:...
    > hello, i am trying to design a method in manipulating data over the
    > intranet, and i am wondering which of the following design can get
    > better performance.
    > can u help me? thanks.
    >
    >
    > <<design 1>>
    > A DataTable object which contains 4 columns for each row:
    > id (int), columnA (string), column B (string), column C (string)
    >
    >
    > <<design 2>>
    > A generic List<myData> which contains a list of MyData object.
    >
    > class MyData{
    > int id;
    > string columnA;
    > string columnB;
    > string columnC;
    > }
    >
     
    John Timney \(MVP\), Aug 10, 2006
    #2
    1. Advertising

  3. majorone

    Mike Lowery Guest

    You might also want to consider using a Struct instead of a Class.

    "majorone" <> wrote in message
    news:...
    > hello, i am trying to design a method in manipulating data over the
    > intranet, and i am wondering which of the following design can get
    > better performance.
    > can u help me? thanks.
    >
    >
    > <<design 1>>
    > A DataTable object which contains 4 columns for each row:
    > id (int), columnA (string), column B (string), column C (string)
    >
    >
    > <<design 2>>
    > A generic List<myData> which contains a list of MyData object.
    >
    > class MyData{
    > int id;
    > string columnA;
    > string columnB;
    > string columnC;
    > }
    >
     
    Mike Lowery, Aug 10, 2006
    #3
  4. the list is faster storage.

    -- bruce (sqlwork.com)

    "majorone" <> wrote in message
    news:...
    > hello, i am trying to design a method in manipulating data over the
    > intranet, and i am wondering which of the following design can get
    > better performance.
    > can u help me? thanks.
    >
    >
    > <<design 1>>
    > A DataTable object which contains 4 columns for each row:
    > id (int), columnA (string), column B (string), column C (string)
    >
    >
    > <<design 2>>
    > A generic List<myData> which contains a list of MyData object.
    >
    > class MyData{
    > int id;
    > string columnA;
    > string columnB;
    > string columnC;
    > }
    >
     
    bruce barker \(sqlwork.com\), Aug 10, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gnanaprakash Rathinam

    CreateInstranceAndUnwrap slow perfomance

    Gnanaprakash Rathinam, Dec 29, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,123
    David Levine
    Dec 30, 2004
  2. Fredrik Melin

    Server perfomance

    Fredrik Melin, Oct 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    414
    Paul Glavich [MVP - ASP.NET]
    Oct 27, 2004
  3. Scott Reynolds

    data perfomance?

    Scott Reynolds, Mar 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    424
    Karl Seguin
    Mar 1, 2005
  4. George

    Huge HTML output perfomance

    George, Mar 28, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    672
    Robbe Morris [C# MVP]
    Mar 29, 2005
  5. James T.

    Perfomance test

    James T., Feb 26, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    406
    James T.
    Feb 26, 2006
Loading...

Share This Page