[Patches] [ python-Patches-977074 ] speed up md5: allow Encode and
Decode to inline
SourceForge.net
noreply at sourceforge.net
Mon Jun 21 18:39:19 EDT 2004
Patches item #977074, was opened at 2004-06-21 15:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=977074&group_id=5470
Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthew Mueller (donut)
Assigned to: Nobody/Anonymous (nobody)
Summary: speed up md5: allow Encode and Decode to inline
Initial Comment:
gcc will only inline functions if they are defined
before where they are used. So this patch just moves
Encode and Decode up to the top of the file.
This can provide a couple percent improvement in speed.
(try
timeit.py -s 'import md5; m=md5.new(); d="a"*64'
'm.update(d);m.digest()'
and
timeit.py -s 'import md5; m=md5.new(); d="a"*0x100000'
'm.update(d)'
)
Decode is only used once, so allowing it to inline
actually reduces the code size, Encode is used twice
but its a pretty small function so it doesn't change
the size much either way..
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=977074&group_id=5470
More information about the Patches
mailing list