tokenizer.encode and tokenizer.encode_plus shouldn’t be used anymore, actually. You can just call the tokenizer, both on a single input or on a batch of inputs:
# single input
sentences = "this movie is very good"
encoding = tokenizer(sentence, max_length=512, truncation=True, padding='max_length', return_tensors='pt')

# batch of inputs
sentences = ["I like this movie a lot", "This movie is super bad"]
encoding = tokenizer(sentences, max_length=512, truncation=True, padding='max_length', return_tensors='pt')

If you want to further improve inference time, you can convert it to ONNX, as explained in the docs 1.