         }
         let time2 = NSDate()
         
+        encodedsize = buf.count
+        
         let time3 = NSDate()
         for _ in 0..<iterations {
             if lazyrun {

    print("\(((decode+use+dealloc) * 1000).string(0)) ms decode+use+dealloc")
    print("=================================")
    print("Total counter is \(total)") // just to make sure we dont get optimized out
    print("=================================")
    print("")
}


let iterations = 1000
let inner_loop_iterations = 1000
let bufsize = 4096
var buf = [UInt8](count: bufsize, repeatedValue: 0)
var encodedsize = 0

func flatencode(inout buf:[UInt8], _ bufsize:Int)
{
