I know it is not your fault but 
```if (verbose && SG_UNLIKELY(sg_io->loglevel_above(MSG_DEBUG)))``` is pure pain. Printing should never be done via variables. If one does costly computations in an algorithm, the results should just be saved to a vector which has a getter. Then SG_INFO can be used. SG_DEBUG is for other things.

Could you clean that up in a patch?