News for hackers. Stuff that matters.
Re:What’s New In Python 3.6 by lqdc13 on Wednesday December 07, 2016 @02:54PM (#13125642)
It is an order of magnitude slower and not less memory efficient. Also, for me it is never easier to understand what is going on when named tuples are used instead of dicts

Proof:

    def make_dicts():
        res = []
        for i in range(1000000):
            res.append({'x': i, 'y': i})
        return res

    def make_tuples():
        templ = namedtuple('Point', ('x', 'y'))
        res = []
        for i in range(1000000):
            res.append(templ(i, i))
        return res

    from ipython_memory_usage import ipython_memory_usage as imu
    imu.start_watching_memory()
    used 0.2305 MiB RAM in 4.00s, peaked 0.00 MiB above current, total RAM usage 86.41 MiB

    %time tuples = make_tuples()
    CPU times: user 780 ms, sys: 32 ms, total: 812 ms
    Wall time: 816 ms
    used 109.0625 MiB RAM in 0.92s, peaked 0.00 MiB above current, total RAM usage 195.47 MiB

    %time dicts = make_dicts()
    CPU times: user 160 ms, sys: 32 ms, total: 192 ms
    Wall time: 194 ms
    used 99.5117 MiB RAM in 0.30s, peaked 0.00 MiB above current, total RAM usage 524.33 MiB
Re:What’s New In Python 3.6 by burntsushi on Thursday December 08, 2016 @05:24PM (#13134859)
Your sibling got opposite results. I haven't dissected either program, but I don't see any obvious flaws. I find your results particularly surprising. Can you explain them? Are there optimisations going on in your benchmark that you haven't accounted for?

It should not be controversial that namedtuples are clearer for the reason I stated in my initial comment.

Re:What’s New In Python 3.6 by lqdc13 on Friday December 09, 2016 @02:45AM (#13137340)
sys.getsizeof() on a code object returns the size of the code struct, not all the other objects it references.

To measure real usage, you have to use another method. I use ipython_memory_usage because it's easy to use.

You can test this out easily by making a large dict and see how much your OS thinks python is using vs what sys.getsizeof is reporting.