Performance Backport

pulls performance improvements, bug fixes, and crash fixes from newer versions to this one