saprykin / plibsys

Highly portable C system library: threads and synchronization primitives, sockets (TCP, UDP, SCTP), IPv4 and IPv6, IPC, hash functions (MD5, SHA-1, SHA-2, SHA-3, GOST), binary trees (RB, AVL) and more. Native code performance.
MIT License
684 stars 75 forks source link

Optimize code with P_LIKELY and P_UNLIKELY #13

Closed saprykin closed 8 years ago

saprykin commented 8 years ago

These macros can improve performance for the branching code.

saprykin commented 8 years ago

Done. A pessimistic scenario is preferred for the failed cases.