[issue33124] Lazy execution of module bytecode

2018-03-28 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

Serhiy: There is a semi-common case where global constants can be quite 
expensive, specifically, initializing a global full of expensive to 
compute/serialize data so it will be shared post-fork when doing 
multiprocessing on a POSIX system. That said, that would likely be a case where 
lazy initialization would be a problem; you don't want each worker 
independently initializing the global lazily.

Also, for all practical purposes, aren't enums and namedtuples global constants 
too? Since they don't rely on any syntax based support at point of use, they're 
just a "function call" followed by assignment to a global name; you couldn't 
really separate the concept of global constants from enums/namedtuple 
definitions, right?

--
nosy: +josh.r

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33124] Lazy execution of module bytecode

2018-03-27 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Function definitions usually are cheap, as well as global constants definitions 
(unless they use complex comprehensions or call heavy functions for 
initialization). Creating a class is an order or more slower than creating a 
function. Creating enums and namedtuples is an order or two slower than 
creating a plain class.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Brett Cannon

Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Neil Schemenauer

Change by Neil Schemenauer :


--
keywords: +patch
pull_requests: +5941

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33124] Lazy execution of module bytecode

2018-03-22 Thread Neil Schemenauer

New submission from Neil Schemenauer :

This is an experimental patch that implements lazy execution of top-level 
definitions in modules (functions, classes, imports, global constants).  See 
Tools/lazy_compile/README.txt for details.

--
components: Interpreter Core
messages: 314294
nosy: nascheme
priority: low
severity: normal
stage: patch review
status: open
title: Lazy execution of module bytecode
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com