Well its not wise to guess about why you experienced this problem. A proper investigation would require a testcase that recaptures it.
My hunch would be that you was discarding the std::string between lines (thereby not reusing the buffer and causing additional memory allocation for each line)... but I'm not sure even that would cause a 12 fold slowdown.