[Python-bugs-list] [ python-Bugs-419390 ] base64.py could be smarter...

noreply@sourceforge.net noreply@sourceforge.net
Thu, 26 Apr 2001 23:57:04 -0700


Bugs item #419390, was updated on 2001-04-26 23:57
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419390&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Anthony Baxter (anthonybaxter)
Assigned to: Nobody/Anonymous (nobody)
Summary: base64.py could be smarter...

Initial Comment:
base64.encodestring and decodestring take the
provided string, wrap it in a StringIO, then 
pass it to encode/decode which uses read() to 
pull it back out again. 

Seems pretty inefficient.

Replacing decodestring with:
  return binascii.a2b_base64(s)

results in a speedup of a factor of 16 or so.
(my sample: a 2Mb encoded voice message - takes
an average of 10s in the current form, and 0.6s
using just binascii.)

A similar speedup for encodestring seems possible.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=419390&group_id=5470