Code for python used is mainly from dparrini/python-comtrade.
Just patch the code in BinaryDatReader.parse
for parsing a little more efficiently.
Basicly, the raw code in dparrini/python-comtrade is used like this:
from comtrade import Comtrade
rec = Comtrade()
rec.load(cfg_file,dat_file)
With Comtrade-GPRC
, you may write like this:
from comtrade_grpc import Comtrade
# Passing a grpc_endpoint param will lead to using of parse() func in go with grpc
# 0ms
rec = comtrade_grpc.Comtrade(grpc_endpoint='localhost:50051')
rec.load(cfg_file,dat_file)
# 497.397ms
rec = comtrade_grpc.Comtrade()
rec.load(cfg_file,dat_file)
# 5809.528ms
$cd comtrade_grpc_server_go
$go mod tidy
$go run .
server listening at [::]:50051
Just build the grpc-server.base.dockerfile