edgexfoundry / device-opc-ua

Apache License 2.0
28 stars 26 forks source link

feat: support reuse opcua.Client #48

Closed ethan256 closed 2 months ago

ethan256 commented 2 months ago

PR Checklist

If your build fails due to your commit message not passing the build checks, please review the guidelines here.

Please check if your PR fulfills the following requirements:

Testing Instructions

New Dependency Instructions (If applicable)

jiekechoo commented 2 months ago

@ethan256 You should Sign-Off the commit. Just use the command: git commit -s -m "comments"

jiekechoo commented 2 months ago

Please rebase your commits to single one.

ethan256 commented 2 months ago

Please rebase your commits to single one.

Okay, thanks for the guidance. benchmark test result for readhandler as follow:

Listening on 0.0.0.0:48408
goos: linux
goarch: amd64
pkg: github.com/edgexfoundry/device-opc-ua/internal/driver
cpu: AMD Ryzen 7 5800H with Radeon Graphics         
Benchmark_HandleReadCommands_ReuseClient-4            1399      715975 ns/op       70625 B/op        172 allocs/op
Benchmark_HandleReadCommands_WithoutReuseClient-4     235      5325039 ns/op      566047 B/op       1224 allocs/op
PASS