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

Fixes #9855: Add the performance patch to the CFEngine 3.10.0b1 to test actual policy execution performance #1160

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,34 @@
From 1c76412c2c8e70a813f267f5dcd4d17d3aad8693 Mon Sep 17 00:00:00 2001
From: Alexis Mousset <contact@amousset.me>
Date: Wed, 30 Nov 2016 20:34:52 +0100
Subject: [PATCH] CFE-2524: Only call BundleResolvePromiseType when it is
needed as it is an expensive call

---
libpromises/expand.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libpromises/expand.c b/libpromises/expand.c
index 002588a..c8b4ecd 100644
--- a/libpromises/expand.c
+++ b/libpromises/expand.c
@@ -647,14 +647,14 @@ void BundleResolve(EvalContext *ctx, const Bundle *bundle)
"Resolving classes and variables in 'bundle %s %s'",
bundle->type, bundle->name);

- /* Necessary to parse vars *before* classes for cases like this:
- * 00_basics/04_bundles/dynamic_bundlesequence/dynamic_inputs_based_on_class_set_using_variable_file_control_extends_inputs.cf.sub
- * -- see bundle "classify". */
- BundleResolvePromiseType(ctx, bundle, "vars", VerifyVarPromise);
-
/* PRE-EVAL: evaluate classes of common bundles. */
if (strcmp(bundle->type, "common") == 0)
{
+ /* Necessary to parse vars *before* classes for cases like this:
+ * 00_basics/04_bundles/dynamic_bundlesequence/dynamic_inputs_based_on_class_set_using_variable_file_control_extends_inputs.cf.sub
+ * -- see bundle "classify". */
+ BundleResolvePromiseType(ctx, bundle, "vars", VerifyVarPromise);
+
BundleResolvePromiseType(ctx, bundle, "classes", VerifyClassPromise);
}