I want to send a a byte array which is not possible with the inbuilt HTTP Sampler.
So went ahead with BeanShell sampler.
But i found some time lagging in response of BeanShell Sampler
In my code I am sending a hard-coded byte array to the web service endpoint.
Is there a better approach like Java Request or JSR223 whose execution time is lesser than that of beanshell sampler
解决方案
Well-behaved JSR223 Sampler with Groovy language and Compilation Cache feature enabled will work faster and have lesser memory footprint than Beanshell. Remember not to reference JMeter Functions or Variables in form of ${var} directly in Groovy script body.
Java Request sampler will the fastest one, however it will be harder to make changes as you will have to recompile your code, put it to JMeter Classpath and restart JMeter even for trivial change.
Particularly in your case you can use HTTP Raw Request instead of scripting.