Existe uma maneira rápida de analisar um arquivo grande com regex?

Problema: Arquivo muito, muito grande, preciso analisar linha por linha para obter 3 valores de cada linha. Tudo funciona, mas leva muito tempo para analisar todo o arquivo. É possível fazer isso em segundos? O tempo típico de sua tomada é entre 1 minuto e 2 minutos.

O tamanho do arquivo de exemplo é 148,208 KB

Eu estou usando o regex para analisar todas as linhas:

Aqui está o meu código c #:

private static void ReadTheLines(int max, Responder rp, string inputFile)
{
    List<int> rate = new List<int>();
    double counter = 1;
    try
    {
        using (var sr = new StreamReader(inputFile, Encoding.UTF8, true, 1024))
        {
            string line;
            Console.WriteLine("Reading....");
            while ((line = sr.ReadLine()) != null)
            {
                if (counter <= max)
                {
                    counter++;
                    rate = rp.GetRateLine(line);
                }
                else if (max == 0)
                {
                    counter++;
                    rate = rp.GetRateLine(line);
                }
            }
            rp.GetRate(rate);
            Console.ReadLine();
        }
    }
    catch (Exception e)
    {
        Console.WriteLine("The file could not be read:");
        Console.WriteLine(e.Message);
    }
}

Aqui está o meu regex:

public List<int> GetRateLine(string justALine)
{
    const string reg = @"^\d{1,}.+\[(.*)\s[\-]\d{1,}].+GET.*HTTP.*\d{3}[\s](\d{1,})[\s](\d{1,})$";
    Match match = Regex.Match(justALine, reg,
                                RegexOptions.IgnoreCase);

    // Here we check the Match instance.
    if (match.Success)
    {
        // Finally, we get the Group value and display it.

        string theRate = match.Groups[3].Value;
        Ratestorage.Add(Convert.ToInt32(theRate));
    }
    else
    {
        Ratestorage.Add(0);
    }
    return Ratestorage;
}

Aqui está uma linha de exemplo para analisar, geralmente em torno de 200.000 linhas:

10.10.10.10 - - [27 / Nov / 2002: 16: 46: 20 -0500] "GET / solr / HTTP / 1.1" 200 4926 789

questionAnswers(4)

yourAnswerToTheQuestion