-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: expose lua vm pool size as flag #7049
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,11 +42,11 @@ type ConfigurableInterpreter struct { | |||||||||
|
|
||||||||||
| // NewConfigurableInterpreter builds a new interpreter by registering the | ||||||||||
| // event handler to the provided informer instance. | ||||||||||
|
Comment on lines
43
to
44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function comment for
Suggested change
References
|
||||||||||
| func NewConfigurableInterpreter(informer genericmanager.SingleClusterInformerManager) *ConfigurableInterpreter { | ||||||||||
| func NewConfigurableInterpreter(informer genericmanager.SingleClusterInformerManager, pool int) *ConfigurableInterpreter { | ||||||||||
| return &ConfigurableInterpreter{ | ||||||||||
| configManager: configmanager.NewInterpreterConfigManager(informer), | ||||||||||
| // TODO: set an appropriate pool size. | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||
| luaVM: luavm.New(false, 10), | ||||||||||
| luaVM: luavm.New(false, pool), | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,9 +254,9 @@ func (p *ConfigurableInterpreter) getCustomAccessor(kind schema.GroupVersionKind | |
| } | ||
|
|
||
| // NewConfigurableInterpreter return a new ConfigurableInterpreter. | ||
| func NewConfigurableInterpreter() *ConfigurableInterpreter { | ||
| func NewConfigurableInterpreter(pool int) *ConfigurableInterpreter { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function comment for // NewConfigurableInterpreter return a new ConfigurableInterpreter with a specific Lua VM pool size.References
|
||
| return &ConfigurableInterpreter{ | ||
| configManager: NewThirdPartyConfigManager(), | ||
| luaVM: luavm.New(false, 10), | ||
| luaVM: luavm.New(false, pool), | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to
pkg/karmadactl/interpret/execute.go, the pool size10is hardcoded here. To improve maintainability and avoid magic numbers, it would be better to define a constant for this default value in a shared location and use it consistently across the codebase.