def METHOD_NAME(iterator, chunk_size=None, fill_size=False, yield_empty=False):
    """
    Old implementation of read_in_chunks without performance optimizations from #1847.
    It's only here so we can directly measure compare performance of old and the new version.
    """
    chunk_size = chunk_size or CHUNK_SIZE
    try:
        get_data = iterator.read
        args = (chunk_size,)
    except AttributeError:
        get_data = next
        args = (iterator,)
    data = b("")
    empty = False
    while not empty or len(data) > 0:
        if not empty:
            try:
                chunk = b(get_data(*args))
                if len(chunk) > 0:
                    data += chunk
                else:
                    empty = True
            except StopIteration:
                empty = True
        if len(data) == 0:
            if empty and yield_empty:
                yield b("")
            return
        if fill_size:
            if empty or len(data) >= chunk_size:
                yield data[:chunk_size]
                data = data[chunk_size:]
        else:
            yield data
            data = b("")