Bencode optimization