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

Unnecessary merging of variables during process instance creation #12038

Open
Tracked by #12035
Zelldon opened this issue Mar 15, 2023 · 0 comments
Open
Tracked by #12035

Unnecessary merging of variables during process instance creation #12038

Zelldon opened this issue Mar 15, 2023 · 0 comments
Labels
area/performance Marks an issue as performance related component/engine component/zeebe Related to the Zeebe component/team kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc.

Comments

@Zelldon
Copy link
Member

Zelldon commented Mar 15, 2023

Description

Related to #12035

Related to #12033
Came up in #11813

Setting variables during process instance creation

When a new process instance is created any given variables are set in the process instance scope. Therefore, it calls #mergeLocalDocument():

https://github.com/camunda/zeebe/blob/ae6dbfc5439c889ad8b8fd24d7431b46110c7900/engine/src/main/java/io/camunda/zeebe/engine/processing/variable/VariableBehavior.java#L60-L80

This iterates over the variables to set and check if a variable with the given name already exists in the scope:

https://github.com/camunda/zeebe/blob/ae6dbfc5439c889ad8b8fd24d7431b46110c7900/engine/src/main/java/io/camunda/zeebe/engine/processing/variable/VariableBehavior.java#L186-L187

This results in unnecessary gets in RocksDB, because at that point could have known that it creates a new instance and set initially the variables. Instead, Zeebe could just set the variable without checking for any potential existing variables, see 12b4699

@Zelldon Zelldon added kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. area/performance Marks an issue as performance related component/engine labels Mar 15, 2023
@romansmirnov romansmirnov added the component/zeebe Related to the Zeebe component/team label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance Marks an issue as performance related component/engine component/zeebe Related to the Zeebe component/team kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc.
Projects
None yet
Development

No branches or pull requests

2 participants