Can't help you much on why it's so slow, But if you're using VC++ for this, you're probably using the debug configuration, usually adds a few hundered k onto it. If you set the config to Release then it'll probably drop down to less then 100k...