Minor changes and some type hints changes for performance improvements.
Add performance notes on documentation.
Add bench code.