Message74224
| Author |
ldeller |
| Recipients |
ldeller |
| Date |
2008年10月03日.03:25:04 |
| SpamBayes Score |
8.943549e-08 |
| Marked as misclassified |
No |
| Message-id |
<1223004306.88.0.574076862856.issue4024@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here is a patch to make PyFloat_FromDouble(0.0) always return the same
float instance. This is similar to the existing optimization in
PyInt_FromLong(x) for small x.
My own motivation is that the patch reduces memory by several megabytes
for a particular in-house data processing script, but I think that it
should be generally useful assuming that zero is a very common float
value, and at worst almost neutral when this assumption is wrong. The
minimal performance impact of the test for zero should be easily
recovered by reduced memory allocation calls. I am happy to look into
benchmarking if you require empirical performance data. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年10月03日 03:25:07 | ldeller | set | recipients:
+ ldeller |
| 2008年10月03日 03:25:06 | ldeller | set | messageid: <1223004306.88.0.574076862856.issue4024@psf.upfronthosting.co.za> |
| 2008年10月03日 03:25:05 | ldeller | link | issue4024 messages |
| 2008年10月03日 03:25:05 | ldeller | create |
|