High-Performance Rule Evaluation
Business rules engines often become part of an organization’s operational critical path. They participate in:
- transaction processing
- underwriting
- eligibility validation
- pricing calculation
- fraud detection
- workflow automation
- customer segmentation
- compliance enforcement
- operational policy enforcement
- AI-assisted decision pipelines
In these environments, execution speed, scalability, and runtime reliability are not secondary concerns - they are architectural requirements.
Code Effects was designed from the beginning as a compiled execution engine rather than an interpreted rule-processing platform. Instead of repeatedly parsing or interpreting rules at runtime, Code Effects compiles rules into executable IL-based objects that operate directly inside the .NET runtime. This architecture delivers deterministic high-performance execution suitable for large-scale enterprise workloads and mission-critical operational systems.
In benchmark scenarios, the engine has demonstrated the ability to evaluate ONE MILLION object instances against a simple rule in less than 10 milliseconds. In production since 2009, it runs today in hundreds of multi-threaded production environments worldwide.
Compiled Business Logic
Many business rules engines rely on interpreted execution models. In these architectures, the engine continuously processes rule definitions at runtime by traversing internal expression trees, metadata graphs, scripting structures, or serialized rule representations. While flexible, interpreted execution introduces additional runtime overhead:
- repeated parsing
- dynamic resolution
- execution indirection
- metadata traversal
- runtime interpretation costs
Code Effects uses a different approach: rules are compiled into executable IL-backed delegates and objects optimized for direct execution inside the CLR. This allows the rules engine to behave much more like native application logic rather than an external scripting layer. The result is:
- significantly lower execution overhead
- faster evaluation speed
- reduced runtime allocations
- predictable execution behavior
- better scalability under load
especially in high-frequency evaluation environments.
A rule is compiled once, and the compiled evaluator can be kept and reused for every evaluation that follows. The same compiled rule can also filter in-memory collections of .NET objects through LINQ to Objects, so one rule definition drives both decisions and data selection at the same speed. See Evaluation Performance Tips for recommendations on caching and reuse.
Native .NET Runtime Optimization
Because rules are compiled directly into executable .NET objects, the engine benefits naturally from CLR-level runtime optimizations including:
- JIT compilation
- runtime optimization
- memory management optimization
- efficient delegate execution
- optimized method dispatch
- runtime inlining opportunities
This allows rules to execute as part of the application runtime itself rather than as detached interpreted workflows. For engineering teams, this means business rules can participate in high-performance application architectures without becoming an operational bottleneck.
Because the engine runs in-process, there is no network round trip, serialization or remote service between your application and its decisions. Built on .NET Standard 2.0, it brings the same compiled performance to .NET Framework 4.6.2 and later and to .NET Core 2.0 and later, including .NET 8 and later, on Windows, Linux and macOS, in containers and in the cloud.
Thread-Safe by Design
Enterprise decision systems rarely execute sequentially. Modern workloads increasingly rely on:
- multithreaded services
- asynchronous processing
- distributed workers
- parallel execution pipelines
- containerized workloads
- cloud-native scaling models
Code Effects was designed to operate safely in these environments. The engine is stateless and fully thread-safe, and supports highly concurrent execution scenarios without requiring isolated runtime instances per thread or complex synchronization architectures. Rules are compiled once and can be evaluated across multiple threads without contention or shared-state issues.
Audit, added in version 7, records production evaluations through a local journal and a background worker, so by default recording never slows a decision. A strict synchronous mode is also available.
Managed Rules at Full Engine Speed
Version 7 adds the Rule Repository, with immutable versions, approvals, testing and a live version per rule. None of this management happens on the evaluation path. Your production code loads the live versions of its rules, together with the rules they depend on, as a complete ruleset, then compiles and evaluates them exactly like any other rule:
- rules from the Rule Repository run at the same compiled speed
- rules loaded through Audit are compiled the same way and run at the same speed
- dependency resolution between reusable and inline rules is done when the ruleset is loaded
- no repository or database call is made per evaluation
Verification happens before production, not on the evaluation path. Tests in the Rule Repository run a rule version on your real classes, can be saved and run in batches of up to 350 whenever a rule changes, and show the decision path behind each outcome, before a version ever goes live.
Richer Rules, Same Compiled Execution
Version 7 makes more decisions expressible as single, readable rules, and every new element of the rule language is compiled like the rest of the rule:
- membership conditions with is in and is not in
- inclusive ranges with is between and is not between
- collection functions: exists, does not exist, all, first, last, count and count with
- string composition with Concatenate
- date shifts by days, months or years
- date-only, time-only, offset and duration values
- inline rules that run other execution rules from THEN and ELSE
- numeric comparisons using the wider of the two types
Logic that once required several rules, helper methods or chains of alternatives can now be written as one rule, without giving up compiled execution.
AI Integration Without Sacrificing Performance
Version 6 introduced Adaptive Source and Prompt-enabled rule elements for integrating AI-assisted evaluation into deterministic rule execution.
Importantly, the core execution engine remains compiled and deterministic.
Organizations can selectively incorporate AI-driven conditions only where probabilistic evaluation is actually required while preserving compiled high-performance execution for the remainder of the rule pipeline. This hybrid architecture allows enterprises to combine:
- deterministic compiled logic
- high-throughput rule execution
- AI-assisted evaluation
- operational scalability
- runtime predictability
inside a single decision infrastructure.
Version 7 brings AI into rule authoring and investigation as well. The AI Rule Editor and the AI Assistant in the Rule Repository, and AI agents connected through the MCP server, write and change rules at authoring time, not at evaluation time. Every rule they save is checked against its structure and source object and becomes ordinary Rule XML, and once a person approves it and it goes live, it is compiled and evaluated at the same speed as a rule written by hand.