def ibatch(iterable, chunk_size=1):
    """
    Takes an iterable and yields individuals while chunking for performance.
    :param iterable: The iterable object to be chunked.
    :param chunk_size: Number of items to chunk before yielding individuals.
    :return: iterable
    """
    chunk_count = 0
    while 1:
        start = chunk_size * chunk_count
        data = iterable[start:start + chunk_size]
        try:
            for i in range(chunk_size):
                yield data[i]
        except IndexError:
            return
        chunk_count += 1
