<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objdict.c, branch 2.1.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.1.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.1.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-08-11T06:43:07+00:00</updated>
<entry>
<title>py/modsys: Initial implementation of sys.getsizeof().</title>
<updated>2017-08-11T06:43:07+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-08-11T06:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bfc2092dc55d1faab4a6d7e832005afd61d25c3c'/>
<id>urn:sha1:bfc2092dc55d1faab4a6d7e832005afd61d25c3c</id>
<content type='text'>
Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and
instances.
</content>
</entry>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py/objdict: Factorise dict accessor helper to reduce code size.</title>
<updated>2017-07-04T13:24:59+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-07-04T13:24:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8b84b8ab8a1e8136b042fe69b530a1fd45c20ae1'/>
<id>urn:sha1:8b84b8ab8a1e8136b042fe69b530a1fd45c20ae1</id>
<content type='text'>
Code size change in bytes for this patch is:

   bare-arm:   -72
minimal x86:   -48
   unix x64:   -32
unix nanbox:  -120
     stmhal:   -68
     cc3200:   -64
    esp8266:   -56
</content>
</entry>
<entry>
<title>py: Optimise types for common case where type has a single parent type.</title>
<updated>2017-04-12T03:22:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-06T02:09:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=816413e4b20ccd463321558458bb63c310712bca'/>
<id>urn:sha1:816413e4b20ccd463321558458bb63c310712bca</id>
<content type='text'>
The common cases for inheritance are 0 or 1 parent types, for both built-in
types (eg built-in exceptions) as well as user defined types.  So it makes
sense to optimise the case of 1 parent type by storing just the type and
not a tuple of 1 value (that value being the single parent type).

This patch makes such an optimisation.  Even though there is a bit more
code to handle the two cases (either a single type or a tuple with 2 or
more values) it helps reduce overall code size because it eliminates the
need to create a static tuple to hold single parents (eg for the built-in
exceptions).  It also helps reduce RAM usage for user defined types that
only derive from a single parent.

Changes in code size (in bytes) due to this patch:

    bare-arm:       -16
    minimal (x86): -176
    unix (x86-64): -320
    unix nanbox:   -384
    stmhal:         -64
    cc3200:         -32
    esp8266:       -108
</content>
</entry>
<entry>
<title>py: Shorten a couple of error messages.</title>
<updated>2017-03-29T01:36:46+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-03-29T01:36:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=18c059febfd713271155d25a3a28661e8911ef8d'/>
<id>urn:sha1:18c059febfd713271155d25a3a28661e8911ef8d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Use mp_raise_TypeError/mp_raise_ValueError helpers where possible.</title>
<updated>2017-03-28T11:37:26+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-03-28T11:37:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=94c41bb06f6482ece0717c5bd63266b8da063caa'/>
<id>urn:sha1:94c41bb06f6482ece0717c5bd63266b8da063caa</id>
<content type='text'>
Saves 168 bytes on bare-arm.
</content>
</entry>
<entry>
<title>py: De-optimise some uses of mp_getiter, so they don't use the C stack.</title>
<updated>2017-02-16T08:11:34+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-13T04:44:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e6003f466e6f5b7eddd01740666230b62ab5a872'/>
<id>urn:sha1:e6003f466e6f5b7eddd01740666230b62ab5a872</id>
<content type='text'>
In these cases the heap is anyway used to create a new object so no real
need to use the C stack for iterating.  It saves a few bytes of code size.
</content>
</entry>
<entry>
<title>py: Add iter_buf to getiter type method.</title>
<updated>2017-02-16T07:38:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-09T23:14:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ae8d86758631e62466a55d179897d2111c3cb1c1'/>
<id>urn:sha1:ae8d86758631e62466a55d179897d2111c3cb1c1</id>
<content type='text'>
Allows to iterate over the following without allocating on the heap:
- tuple
- list
- string, bytes
- bytearray, array
- dict (not dict.keys, dict.values, dict.items)
- set, frozenset

Allows to call the following without heap memory:
- all, any, min, max, sum

TODO: still need to allocate stack memory in bytecode for iter_buf.
</content>
</entry>
<entry>
<title>py/objdict: Convert mp_uint_t to size_t where appropriate.</title>
<updated>2017-02-16T05:51:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-16T05:15:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1ea2f7a8ce0353e423253135e417c02dc6466405'/>
<id>urn:sha1:1ea2f7a8ce0353e423253135e417c02dc6466405</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Use mp_raise_msg helper function where appropriate.</title>
<updated>2016-10-17T01:17:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-17T01:17:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7d0d7215d2575a2d36d34c9a13b58cade0610a28'/>
<id>urn:sha1:7d0d7215d2575a2d36d34c9a13b58cade0610a28</id>
<content type='text'>
Saves the following number of bytes of code space: 176 for bare-arm, 352
for minimal, 272 for unix x86-64, 140 for stmhal, 120 for esp8266.
</content>
</entry>
</feed>
