Micro Python -- a lean and efficient implementation of Python 3
Paul Rubin
no.email at nospam.invalid
Wed Jun 4 14:25:46 EDT 2014
Tim Chase <python.list at tim.thechases.com> writes:
> As mentioned elsewhere, I've got a LOT of code that expects that
> string indexing is O(1) and rarely are those strings/offsets reused
> I'm streaming through customer/provider data files, so caching
> wouldn't do much good other than waste space and the time to maintain
> them.
I'm having trouble understanding -- if they're only used once then
what's the problem? You're reading some enormous file into a string and
then randomly accessing it by character offset? What size are these
strings? I can think of a number of workarounds including language
extensions, but mostly I'd be interested in seeing some actual
benchmarks of your unmodified program under both representations.
More information about the Python-list
mailing list