Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute "es-node -v" is a slower (4s) than excepted (less than 1s) #83

Open
ping-ke opened this issue Nov 18, 2023 · 0 comments
Open

Execute "es-node -v" is a slower (4s) than excepted (less than 1s) #83

ping-ke opened this issue Nov 18, 2023 · 0 comments
Assignees

Comments

@ping-ke
Copy link
Contributor

ping-ke commented Nov 18, 2023

Execute "es-node -v" is slower than expected, that is because our Flags are implemented in different packages (flags, eslog, signer, miner) which also import other packages, so our init costs seconds to finish. the go process flow is https://pic3.zhimg.com/80/v2-ca6f92e42e1a1e75051f6af121d9f5aa_720w.webp.

cmd/es-node/main.go

func main() {
... ...
	app.Flags = flags.Flags

ethstorage/flags/flags.go

func init() {
	optionalFlags = append(optionalFlags, p2pFlags...)
	optionalFlags = append(optionalFlags, eslog.CLIFlags(envVarPrefix)...)
	optionalFlags = append(optionalFlags, signer.CLIFlags(envVarPrefix)...)
	optionalFlags = append(optionalFlags, miner.CLIFlags(envVarPrefix)...)
	Flags = append(requiredFlags, optionalFlags...)
}

Solution:
Move other flags implementation to ethstorage/flags folder and reduce their import packages.

@ping-ke ping-ke changed the title Execute "es-node -v" is a slower than excepted Execute "es-node -v" is a slower (4s) than excepted (less than 1s) Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant