Easy to (mis)use API
Posted by: Poupous blog,
on 04 Mar 2011 |
View original | Bookmarked: 0 time(s)
Here's another take at reducing string allocations inside Gendarmeusing the newLog Profiler.This time I focused on a very helpful, but easy to abuse, API: StreamReader.ReadLine. Similar methods suffers from similar fates.The .NET framework has quite a few helpers like this one. They work great when quickly hacking a solution but they also have serious limitations in the real world.E.g. how long is a line ? from a Stream it could be infinite, eventually leading to a OutOfMemoryException.Same goes...