On Aug 13, 2019, at 06:45, malincns <malin...@163.com> wrote:
> 
> Thanks for your guidance.
> To be honest, it's a challenge for me.
> It would be nice if an experienced person is willing to make this attempt.

It would be a significant amount of work just to implement it far enough to 
benchmark. So again, I don’t think it’s likely anyone will volunteer if you 
don’t provide some reason to expect it to pan out.

Even if you can’t edit hairy C code like longobject.c, you can write simple 
Python code and benchmark it, search the list archives, etc., just as well as 
anyone else. If that’s not worth your time to do, why do you expect it would be 
worth the time of anyone else? And without that, the only way anyone is likely 
to try this is if they get really bored and happen to want to play with the 
internals of PyLongObject this weekend or something.

> > size 1 or -1 means you use smallnum instead of digits
> 
> Or use this value, this won't consume more memory than current implementation:
> Py_SIZE(a)   32-bit platform  64-bit platform
> LONG_MAX     4 bytes singed   8 bytes singed
> LONG_MAX-1   2 bytes singed   4 bytes singed

On platforms where long is 32 bits even though it’s a 64-bit platform with 
64-bit pointers (like 64-bit Windows), this would effectively waste 32 bits. 
You’d also need to implement a check in the autoconf scripts and then create a 
new typedef and new constants that are used only for this purpose. And why? 
This is exactly the reason C offers types like intptr_t. 


_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/EUJRX7HLPWU6S64JIVIL2Y7XA4ZULPCR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to