on_socket_raw_receive and on_socket_raw_send were added back in an odd
way. The rest of them such as on_socket_closed, on_socket_opened, and
on_socket_receive were removed.
This is a breaking change. Code will still work in Python 3.4 as-is but
if you use Python 3.5 you will have to change your code to the new
`async for` syntax as the older version is not supported in 3.5.
On the other hand, this comes with performance improvements if you use
Python 3.5 as it will lazily load 100 message chunks on an as needed
basis rather than loading all messages in one go.
Replaced server member lists, channel lists, and private channel lists
with dicts. This allows O(1) lookups and removes (previously it would be
an O(N) operation to lookup or remove). I did pretty extensive testing
and benchmarking to compare the performance of using lists vs using
dicts. Iterating through lists to find an item is only faster in the
average case for extremely small lists (less than 3 items). For 100
items, using a dict is about 10 times faster on average (and about 100
times faster for 1000 items). The overhead in dicts is in memory usage
and initial creation time. Creating and populating a dict is about 2 to
3 times slower than creating and appending items to a list. However this
cost is still tiny. For 1000 items this equates to about a 70
microsecond difference (on an i7 CPU) for populating the entire dict.
The memory overhead for a dict (compared to a list) is about 25-60 KB
per 1000 items (can vary depending on dict resizing).
Originally I wanted to use OrderedDicts to presereve order, but in my
testing OrderedDicts have about 6x the memory overhead compared to
normal dicts.