wang xuancong <xuancon...@gmail.com> added the comment:

Thanks @terry.reedy for your expert-level good comments!

1.
"In Python 3, the one *implementation*, and its lookup mode, are fixed.  The 
slower implementation was dropped because it was not thought worth the bother."
If I remember correctly, the performance penalty due to the slower lookup mode 
is not quite significant, in most Python benchmarks, Python2 still performs 
much faster than Python3 because most codes that need speed does not contain 
exec/eval, so the slow mode won't affect in practice.

2.
"When you invoke the save function while playing a game, I am imagine that the 
save function does not have access to and does not same the locals of whatever 
function was executing at the time you hit the save key.  Rather a game and 
player states are serialized, and likely not in one line of code."
I have personally tried this on one implementation of deep neural network using 
Tensorflow, it works pretty well, especially on saving the network parameters 
at every Nth epoch, or resuming training from a particular epoch. The biggest 
advantage is that it does not scale with network size or complexity, so the 
Python code size has a O(1) complexity with network size/complexity and that is 
a small constant O(1) as it does not involve any Python loop. In practice, you 
can select what to save/load, such as those not starting with '_'.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44028>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to