Performance research and benchmarks for GenLayer Intelligent Contract execution
Overview
GenLayer introduces Intelligent Contracts that can work with non-deterministic operations such as Large Language Models (LLMs) and external web data.
Unlike traditional smart contracts, these operations can introduce additional execution time and variability.
This research explores the performance of Intelligent Contract execution and identifies the factors that can affect execution speed and reliability.
The goal is to provide simple, measurable insights that can help developers build more efficient Intelligent Contracts.
Research Objectives
This research aims to:
-
Measure the execution time of different Intelligent Contract operations.
-
Compare simple contract execution with contracts that use LLMs or external data.
-
Identify factors that can increase execution latency.
-
Examine the consistency of repeated executions.
-
Provide recommendations for improving Intelligent Contract performance.
Research Questions
The research focuses on five main questions:
-
How long does a basic Intelligent Contract take to execute?
-
How does execution time change when an LLM is involved?
-
How does accessing external web data affect execution time?
-
How consistent is execution time across repeated executions?
-
What practices can developers use to improve Intelligent Contract performance?
What Will Be Tested
A simple contract that performs basic operations without external data or LLM calls.
This provides a baseline for comparison.
A contract that uses an LLM to process or classify information.
The execution time will be compared with the basic contract.
A contract that retrieves information from an external web source.
This will help determine how external network requests affect execution time.
A contract that retrieves external information and then uses an LLM to process the information.
This represents a more complex Intelligent Contract workflow.
Each test will be executed multiple times.
The results will be compared to determine whether execution time remains consistent or varies significantly between executions.
Performance Metrics
The following metrics will be recorded:
The amount of time required for the contract to complete.
The percentage of executions that complete successfully.
The percentage of executions that fail or cannot reach a valid result.
The difference between the fastest and slowest executions of the same test.
Where applicable, the research will record whether validators reach an accepted result or encounter an undetermined outcome.
Methodology
The tests will be performed using GenLayer's available development and testing tools.
Each contract will be executed multiple times under the same conditions where possible.
For every execution, the following information will be recorded:
-
Contract type
-
Operation performed
-
Execution time
-
Result
-
Success or failure
-
Consensus outcome where applicable
The results will then be organized into a dataset and compared across the different contract types.
Expected Findings
The research expects to find that simple deterministic operations generally have lower execution overhead than operations involving external data or LLMs.
LLM requests and web requests may introduce additional latency because they depend on external systems and responses.
The research will also examine whether repeated executions of the same contract produce consistent performance or significant variations.
These assumptions will be tested using actual benchmark results rather than treated as confirmed findings.
Performance Considerations
Based on the results, several areas may require attention when developing Intelligent Contracts.
Developers may need to minimize unnecessary LLM calls and external web requests because these operations can increase execution time.
Contracts should also avoid repeating the same expensive operation when the result can be reused.
Where possible, developers should keep contract logic simple and structure external information into useful data before performing additional processing.
Recommendations
The final recommendations will be based on the benchmark results.
Potential recommendations include:
-
Reduce unnecessary LLM calls.
-
Reduce repeated external web requests.
-
Keep Intelligent Contract workflows as simple as possible.
-
Reuse results when repeated computation is unnecessary.
-
Measure performance before deploying complex contract logic.
-
Design contracts with execution variability in mind.
Limitations
This research will have some limitations.
Execution time can be affected by network conditions, LLM response time, external websites, and the testing environment.
Results obtained in a development or testing environment may also differ from results on the live network.
Therefore, the results should be treated as benchmark observations rather than a complete representation of all GenLayer Intelligent Contracts.
Conclusion
This research aims to provide a practical overview of Intelligent Contract performance on GenLayer.
By comparing simple execution with LLM-based and web-based operations, the research will identify the main factors that contribute to execution latency and variability.
The findings can help developers understand the performance trade-offs involved in building Intelligent Contracts and encourage more efficient contract design.
Future Research
Future research could investigate:
-
Performance under high transaction volume.
-
Larger and more complex Intelligent Contracts.
-
Different LLM providers.
-
Validator performance.
-
Gas and execution costs.
-
Security versus performance trade-offs.
-
Performance differences between testing environments and the live network.