Performance

merge performance branch with master
Avoid using {...} for multi-line blocks.