Optimize ObjectInput generation

- avoid allocating and destructuring a tuple
- avoid boxing