Data-Driven Implementation of Efficient Protocol Handlers