sorry for the drive-by pull request, but localtrace could use some optimization

Some guys are using this at my work, there seems to be low hanging optimization fruit in the local trace function.

I think this will have a useful impact on traced code performance, but haven't tested.