Performance in c++ of torch script model

Hello. I use torchscript for 1 model. Have some problems with slow performance in c++.
Performance: (linux, cpu)

  • Python: 0.26sec
  • Python torchscript first: 27 sec
  • Python torchscipt second: 0.08sec
  • c++ first: 2sec
  • c++ second: 101sec.

How I can improve performance on c++?
Pls say what additional information I need to show.