Re: [Python-Dev] Python parser performance optimizations

2016-05-30 Thread Bernardo Sulzbach

On 05/29/2016 10:53 PM, Steven D'Aprano wrote:

On Thu, May 26, 2016 at 10:19:05AM +, Artyom Skrobov wrote:
[...]

The motivation for this patch was to enable a memory footprint
optimization, discussed at http://bugs.python.org/issue26415 My
proposed optimization reduces the memory footprint by up to 30% on the
standard benchmarks, and by 200% on a degenerate case which sparked
the discussion. The run time stays unaffected by this optimization.


That can't be right. How can you reduce memory usage by more than one
hundred percent? That would mean you have saved more memory than was
originally used and are now using a negative amount of memory.



It is not. It would be nice to have the values that were used to 
calculate these percentages.

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python parser performance optimizations

2016-05-30 Thread Greg Ewing

Steven D'Aprano wrote:
That can't be right. How can you reduce memory usage by more than one 
hundred percent? That would mean you have saved more memory than was 
originally used and are now using a negative amount of memory.


It emails an order for more RAM to Amazon, who send out
a robot drone to install it in your computer.

--
Greg
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-30 Thread Glenn Linderman

On 5/29/2016 9:57 AM, jon wrote:

The aspects we want to capture in a name or adjective for these types are:

a) The types have identical implementations or definitions.
b) They are distinct types.

I think “Distinguished Type” or”Cloned Type” best captures these qualities.

I think the following also capture the quality, but feel a bit pejorative.

"Segregated Type"
"Arbitrary Type"


"Exclusive Type"

"Separate Type"

Glenn
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python parser performance optimizations

2016-05-30 Thread Guido van Rossum
I know we're all just having fun, but that's probably a rather stressful
welcome to the list. Maybe we can tone down the humor a bit and instead
review the OP's patches?

--Guido (mobile)
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize()

2016-05-30 Thread Brett Cannon
On Fri, 27 May 2016 at 07:50 Vitaly Murashev 
wrote:

> Could anyone please clarify whether it is correct in python3.5 to call
> PyImport_AppendInittab() after Py_Initialize()
>

It should be called before as PyImport_AppendInittab() is shorthand for
PyImport_ExtendInittab() and it says to call prior to Py_Initialize():
https://github.com/python/cpython/blob/f680b517e2701e9a3859afb62628a46eccdce17c/Python/import.c#L2153
 .

-Brett


>
> I found this case among the tests for boost.python
> https://github.com/boostorg/python/blob/develop/test/exec.cpp
>
> And this test doesn't work for me with python3.5.An error looks like:
>
> exec.cpp(137): Python Error detected in function 'void __cdecl
> check_pyerr(bool)'
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: 'embedded_hello' is not a built-in module
> 1 error detected.
>
> After debugging I found out that root cause is in
> importlib/_bootstrap.py which do the following:
>
> if fullname not in sys.builtin_module_names:
> raise ImportError('{!r} is not a built-in
> module'.format(fullname), name=fullname)
>
> but sys.builtin_module_names is the constant which initialized once in
> Py_Initialize()
>
> ---
> To summarize:
> Is it a bug in python3.5 or original test inside boost.python should be
> fixed ?
>
> ___
> Python-Dev mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/brett%40python.org
>
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com