This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年01月03日 17:08 by ebfe, last changed 2022年04月11日 14:56 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| sha1module_small_locks.diff | ebfe, 2009年01月03日 17:08 | |||
| sha256module_small_locks.diff | ebfe, 2009年01月03日 17:08 | |||
| sha512module_small_locks.diff | ebfe, 2009年01月03日 17:09 | |||
| Messages (6) | |||
|---|---|---|---|
| msg78975 - (view) | Author: Lukas Lueg (ebfe) | Date: 2009年01月03日 17:08 | |
Here is the follow-up to issue #4818. The patches attached allow the built-in SHA modules to release the GIL. Also the build-in SHA modules will now no longer accept "s#" as input. Input is parsed just as in the openssl-driven classes where unicode-objects are explicitly rejected. The built-in hash modules have been not quite beautiful before even more code is now copy & pasted between them. Is there any interest in refactoring all those modules? AFAIK _sha1 and such are only used by hashlib.py ... |
|||
| msg79146 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年01月05日 13:58 | |
This patch is a duplicate of #3745. |
|||
| msg79148 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年01月05日 14:00 | |
Oops, it's not a duplicate /o\ But it may solves #3745 (reject unicode in sha256). |
|||
| msg79995 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年01月17日 02:20 | |
sha1module_small_locks.diff patch is very similar to the changes made in #4751, except: - SHA1_GIL_MINSIZE is 8192 whereas HASHLIB_GIL_MINSIZE is 2048 - There is no test for PyThread_allocate_lock() failure Instead of copy/paste code in hashlib, sha1, sha256 and sha512 (4 modules), can't we share some constants, functions or macros? Examples: - the GIL minimum size constant - the long MY_GET_BUFFER_VIEW_OR_ERROUT macro (which can be a function) And about sha, why using 3 files for sha? Are the source code so different? In the GNU libc, they use "template" files (it's possible even with the C language using the preprocessor!): strtof(), strtod() and strtold() share 99% of the source code. Interesting content of strtof.c : ---- #define FLOAT float #define FLT FLT #ifdef USE_WIDE_CHAR #define STRTOF wcstof #define STRTOF_L __wcstof_l #else # define STRTOF strtof # define STRTOF_L __strtof_l #endif #include "strtod.c" ---- Refactoring to share code between hash modules will ease the changes, eg. release the GIL ;-) |
|||
| msg81728 - (view) | Author: Gregory P. Smith (gregory.p.smith) * (Python committer) | Date: 2009年02月12日 07:40 | |
fyi - I took care of the unicode data acceptance issue for all hashlib related modules in the py3k branch in r69524. Yes, the hashlib modules have a -lot- of code in common. Refactoring that would be nice but i haven't looked into it. I at least moved the commonly used #define into a new hashlib.h for the above change. |
|||
| msg172069 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年10月05日 10:28 | |
I'll integrate your patch once I'm done with my SHA-3 patch #16113. I'm using parts of your patch in my new sha3 code to release the GIL. I'll also check if I can share more code between the SHA family modules. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:43 | admin | set | github: 49071 |
| 2016年06月12日 11:22:32 | christian.heimes | set | assignee: christian.heimes -> |
| 2016年04月22日 18:58:35 | christian.heimes | set | versions: + Python 3.6, - Python 3.4 |
| 2012年10月05日 10:28:44 | christian.heimes | set | assignee: christian.heimes type: performance components: + Extension Modules nosy: + christian.heimes messages: + msg172069 stage: patch review |
| 2012年10月04日 21:25:35 | christian.heimes | set | versions: + Python 3.4 |
| 2009年02月12日 07:40:34 | gregory.p.smith | set | nosy:
+ gregory.p.smith messages: + msg81728 |
| 2009年01月29日 11:27:44 | jcea | set | nosy: + jcea |
| 2009年01月17日 02:20:46 | vstinner | set | messages: + msg79995 |
| 2009年01月05日 14:00:39 | vstinner | set | messages: + msg79148 |
| 2009年01月05日 13:58:56 | vstinner | set | nosy:
+ vstinner messages: + msg79146 |
| 2009年01月03日 17:09:06 | ebfe | set | files: + sha512module_small_locks.diff |
| 2009年01月03日 17:08:52 | ebfe | set | files: + sha256module_small_locks.diff |
| 2009年01月03日 17:08:41 | ebfe | set | files:
+ sha1module_small_locks.diff keywords: + patch |
| 2009年01月03日 17:08:23 | ebfe | create | |