performance improvement when loading a large stream into memory