perf improvement: useless buffer allocation in Util.debug