<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/map.c, branch travis-clang</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=travis-clang</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=travis-clang'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-05-20T11:46:20+00:00</updated>
<entry>
<title>py: Declare constant data as properly constant.</title>
<updated>2016-05-20T11:46:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-20T11:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3ff16ff52e45d4c0bf1df5fa650b72d6d835451b'/>
<id>urn:sha1:3ff16ff52e45d4c0bf1df5fa650b72d6d835451b</id>
<content type='text'>
Otherwise some compilers (eg without optimisation) will put this read-only
data in RAM instead of ROM.
</content>
</entry>
<entry>
<title>py/map: Change hash-table allocation policy to be less aggressive.</title>
<updated>2016-04-15T15:24:46+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-15T15:24:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=00137b8c11eb94bbf97d5276d9c4e879ea75fb1d'/>
<id>urn:sha1:00137b8c11eb94bbf97d5276d9c4e879ea75fb1d</id>
<content type='text'>
Small hash tables (eg those used in user class instances that only have a
few members) now only use the minimum amount of memory necessary to hold
the key/value pairs.  This can reduce performance for instances that have
many members (because then there are many reallocations/rehashings of the
table), but helps to conserve memory.

See issue #1760.
</content>
</entry>
<entry>
<title>py/map: Prevent map resize failure from destroying map.</title>
<updated>2016-04-01T13:36:00+00:00</updated>
<author>
<name>Stephen Kyle</name>
<email>stephen.kyle@arm.com</email>
</author>
<published>2016-04-01T09:51:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b475327ffa24a95d9855b9ed38cdd8fe13487f4d'/>
<id>urn:sha1:b475327ffa24a95d9855b9ed38cdd8fe13487f4d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/map: In map lookup, check for fixed map independent of ordered map.</title>
<updated>2015-12-31T00:24:33+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-31T00:19:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6dde019d933175b5c2608b8da2239846e1730838'/>
<id>urn:sha1:6dde019d933175b5c2608b8da2239846e1730838</id>
<content type='text'>
It's possible to have a fixed map that is properly hashed (ie not
simply ordered).
</content>
</entry>
<entry>
<title>py/map: Add fast-path for hashing of map index when it is a qstr.</title>
<updated>2015-12-26T21:15:47+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-26T21:15:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bbe8d51bd9ab0c848ee833000dcc93eb78bcbcad'/>
<id>urn:sha1:bbe8d51bd9ab0c848ee833000dcc93eb78bcbcad</id>
<content type='text'>
Map indicies are most commonly a qstr, and adding a fast-path for hashing
of a qstr increases overall performance of the runtime.

On pyboard there is a 4% improvement in the pystone benchmark for a cost
of 20 bytes of code size.  It's about a 2% improvement on unix.
</content>
</entry>
<entry>
<title>py: Use MP_OBJ_NULL instead of NULL when appropriate.</title>
<updated>2015-11-20T14:09:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-20T14:09:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=83229d3ffe5f8b6ba9c9f90e4ff0185dc0bab81b'/>
<id>urn:sha1:83229d3ffe5f8b6ba9c9f90e4ff0185dc0bab81b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/map: Store key/value in earliest possible slot in hash table.</title>
<updated>2015-11-19T01:27:28+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-19T01:27:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=593faf14c4700afd6c2ba6a281e7d48633e4d688'/>
<id>urn:sha1:593faf14c4700afd6c2ba6a281e7d48633e4d688</id>
<content type='text'>
This change makes the code behave how it was supposed to work when first
written.  The avail_slot variable is set to the first free slot when
looking for a key (which would come from deleting an entry).  So it's
more efficient (for subsequent lookups) to insert a new key into such a
slot, rather than the very last slot that was searched.
</content>
</entry>
<entry>
<title>py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function.</title>
<updated>2015-05-12T21:46:02+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-05-11T12:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c2a4e4effc81d8ab21bb014e34355643e5ca0da2'/>
<id>urn:sha1:c2a4e4effc81d8ab21bb014e34355643e5ca0da2</id>
<content type='text'>
Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as
the operator argument.  Hashing for int, str and bytes still go via
fast-path in mp_unary_op since they are the most common objects which
need to be hashed.

This lead to quite a bit of code cleanup, and should be more efficient
if anything.  It saves 176 bytes code space on Thumb2, and 360 bytes on
x86.

The only loss is that the error message "unhashable type" is now the
more generic "unsupported type for __hash__".
</content>
</entry>
<entry>
<title>py: Some trivial cosmetic changes, for code style consistency.</title>
<updated>2015-04-04T14:53:11+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-04-04T14:53:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2801e6fad8b8b3ecdd9c8bc58f9515ff66eca46c'/>
<id>urn:sha1:2801e6fad8b8b3ecdd9c8bc58f9515ff66eca46c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Clarify API for map/set lookup when removing&amp;adding at once.</title>
<updated>2015-03-20T17:41:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-03-20T17:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d1cee02783666338b526ac686c19440c5f44b258'/>
<id>urn:sha1:d1cee02783666338b526ac686c19440c5f44b258</id>
<content type='text'>
Addresses issue #1160.
</content>
</entry>
</feed>
