MM-27456: Use reflect-free serialization for hot structs (#15171)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2020-08-13 13:05:57 +05:30
коммит произвёл GitHub
родитель 32b7d2b5f1
Коммит 91a76b2df9
34 изменённых файлов: 6224 добавлений и 6 удалений

Просмотреть файл

@@ -554,7 +554,7 @@ vet: ## Run mattermost go vet specific checks
echo "mattermost-govet is not installed. Please install it executing \"GO111MODULE=off GOBIN=$(PWD)/bin go get -u github.com/mattermost/mattermost-govet\""; \
exit 1; \
fi;
@VET_CMD="-license -structuredLogging -inconsistentReceiverName -tFatal"; \
@VET_CMD="-license -structuredLogging -inconsistentReceiverName -inconsistentReceiverName.ignore=serialized_gen.go -tFatal"; \
if ! [ -z "${MM_VET_OPENSPEC_PATH}" ] && [ -f "${MM_VET_OPENSPEC_PATH}" ]; then \
VET_CMD="$$VET_CMD -openApiSync -openApiSync.spec=$$MM_VET_OPENSPEC_PATH"; \
else \
@@ -567,6 +567,13 @@ ifneq ($(MM_NO_ENTERPRISE_LINT),true)
endif
endif
gen-serialized: ## Generates serialization methods for hot structs
# This tool only works at a file level, not at a package level.
# So you would need to move the structs that need to be serialized temporarily
# to session.go and run the tool.
$(GO) get -modfile=go.tools.mod github.com/tinylib/msgp
$(GOBIN)/msgp -file=./model/session.go -tests=false -o=./model/serialized_gen.go
todo: ## Display TODO and FIXME items in the source code.
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime TODO
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime XXX