[MERGE] get_record_stream().get_bytes_as('chunked')

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Dec 11 14:54:30 GMT 2008


>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:

<snip/>

    jam> +        newline = <char *>memchr(c_str, c'\n', the_len)
    jam> +        if newline != c_last and not (newline == NULL and cur == chunks_len):
    >> 
    >> Why don't you keep that construct in python ?

    jam> What construct is that?

The single iteration with a single test instead of special casing
the last item (you may need to use enumerate in the list
comprehension to get 'cur').

    jam> I basically kept iterating the python one until I could
    jam> find the fastest ops I could. Then I did a quick test
    jam> pyrex implementation, and realized it was 5x faster than
    jam> the best python I could write, so I spent more time on
    jam> it.

Not a big deal, I'd prefer a more readable python version anyway.

        Vincent



More information about the bazaar mailing list