Restore old Evaluator switch, and put the new Evaluator behind a flag#347
Merged
stephenamar-db merged 1 commit intomasterfrom Apr 29, 2025
Merged
Restore old Evaluator switch, and put the new Evaluator behind a flag#347stephenamar-db merged 1 commit intomasterfrom
stephenamar-db merged 1 commit intomasterfrom
Conversation
Collaborator
Author
d3ccccb to
d027737
Compare
Contributor
|
@stephenamar-db seems #329 affects performance too. I think I need to reshape it to avoid allocation. |
Contributor
// 定义一个微服务配置生成器
local generateServiceConfig(serviceParams) =
local defaults = {
port: 8080,
replicas: 1,
memoryLimit: '512Mi',
cpuLimit: '0.5',
environmentVars: {},
dependencies: [],
};
local params = defaults + serviceParams;
local params2 = {
name: params.name,
version: params.version,
replicas: params.replicas,
memory: params.memoryLimit,
cpu: params.cpuLimit,
port: params.port,
env: std.manifestJsonEx(params.environmentVars, ' '),
deps: std.join(', ', ['"%s"' % dep for dep in params.dependencies]),
};
|||
// Service configuration for %(name)s
{
name: "%(name)s",
version: "%(version)s",
deployment: {
replicas: %(replicas)d,
resources: {
limits: {
memory: "%(memory)s",
cpu: "%(cpu)s",
},
},
},
networking: {
port: %(port)d,
service: "%(name)s-service",
},
environment: %(env)s,
unset: input.unset,
dependencies: [
%(deps)s
],
}
||| % params2;
// 生成多个服务的配置
local services = {
'user-service': {
name: 'user-service',
version: '1.2.0',
port: 8081,
replicas: 3,
environmentVars: {
DB_HOST: 'postgres.example.com',
LOG_LEVEL: 'info',
},
dependencies: ['auth-service', 'email-service'],
},
'auth-service': {
name: 'auth-service',
version: '1.1.0',
port: 8082,
memoryLimit: '1Gi',
environmentVars: {
JWT_SECRET: 'secret-placeholder',
TOKEN_EXPIRY: '24h',
},
},
};
// 生成每个服务的配置文件内容
{
[svcName + '.jsonnet']: generateServiceConfig(services[svcName])
for svcName in std.objectFields(services)
}we are testing something like this: render it 10_000_000 times; |
Contributor
|
We can collect statistics about Expr and sort them by frequency? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before:
After:
Looks like there's still a small regression somewhere - will continue investigating
Initial 3.3.5 commit