libmc is a memcached client library for Python without any other dependencies in runtime. It's mainly written in C++ and Cython. https://github.com/douban/libmc
29. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Tips
▶ Prefer “switch statements” to if-else condition.
▶ “Exception” and “heap allocation” are slow in C++.
▶ Avoid memory copy.
▶ SmallVector optimization.
▶ Undocumented “UIO MAXIOV” limit in iovec.
▶ clean buffer on error
▶ Server may refuse if too much data is “send”(sent) without
“recv”-ing
▶ Lazy connecting.
▶ GIL issue.
▶ gevent issue.
▶ man 2 recv: For TCP sockets, the return value 0 means the
peer has closed its half side of the connection.
30. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Tips
▶ Prefer “switch statements” to if-else condition.
▶ “Exception” and “heap allocation” are slow in C++.
▶ Avoid memory copy.
▶ SmallVector optimization.
▶ Undocumented “UIO MAXIOV” limit in iovec.
▶ clean buffer on error
▶ Server may refuse if too much data is “send”(sent) without
“recv”-ing
▶ Lazy connecting.
▶ GIL issue.
▶ gevent issue.
▶ man 2 recv: For TCP sockets, the return value 0 means the
peer has closed its half side of the connection.
▶ write the right benchmark. bench order? dependency?
31. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Tips
▶ Prefer “switch statements” to if-else condition.
▶ “Exception” and “heap allocation” are slow in C++.
▶ Avoid memory copy.
▶ SmallVector optimization.
▶ Undocumented “UIO MAXIOV” limit in iovec.
▶ clean buffer on error
▶ Server may refuse if too much data is “send”(sent) without
“recv”-ing
▶ Lazy connecting.
▶ GIL issue.
▶ gevent issue.
▶ man 2 recv: For TCP sockets, the return value 0 means the
peer has closed its half side of the connection.
▶ write the right benchmark. bench order? dependency?
▶ md5 is slow. bugfree fnv1 is hard to implement.
32. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Tips
▶ Prefer “switch statements” to if-else condition.
▶ “Exception” and “heap allocation” are slow in C++.
▶ Avoid memory copy.
▶ SmallVector optimization.
▶ Undocumented “UIO MAXIOV” limit in iovec.
▶ clean buffer on error
▶ Server may refuse if too much data is “send”(sent) without
“recv”-ing
▶ Lazy connecting.
▶ GIL issue.
▶ gevent issue.
▶ man 2 recv: For TCP sockets, the return value 0 means the
peer has closed its half side of the connection.
▶ write the right benchmark. bench order? dependency?
▶ md5 is slow. bugfree fnv1 is hard to implement.
▶ vim: Rip-Rip/clang complete + cpplint.py