C# dynamic generic list-Collection of common programming errors

List compiles the exact same type as List no speed penalties over a typed List, for example, beyond boxing value types. However if you are going to cast to IList you are still going to have the boxing penalty FYI.

You could run into trouble is calling Activator (a reflection method) as it is likely to be dramatically slower that calling a constructor directly.

Does any of this matter? You won’t know unless you actually run profile because it will always depends on your actual usage.

My best guest what you really want to do is:

IList gdb;

switch (trail[dataPos].Type)
{
    case GlobalsSubscriptTypes.Int32:
        gdb = new List();
        break;
    case GlobalsSubscriptTypes.Int64:
        gdb = new List();
        break;
    default:
        gdb = new List();
        break;
}

Also if you really need to do operations without boxing make a generic helper method to do all your work:

switch (trail[dataPos].Type)
{
    case GlobalsSubscriptTypes.Int32:
        return Helper(trail[dataPos]);
    case GlobalsSubscriptTypes.Int64:
        return Helper(trail[dataPos]);
    default:
        return Helper(trail[dataPos]);
}