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

Enhance Configurability in zbench #40

Closed
hendriknielaender opened this issue Jan 14, 2024 · 2 comments
Closed

Enhance Configurability in zbench #40

hendriknielaender opened this issue Jan 14, 2024 · 2 comments
Labels

Comments

@hendriknielaender
Copy link
Owner

hendriknielaender commented Jan 14, 2024

Description

The current implementation of zbench provides essential benchmarking functionalities. However, to increase its utility and adaptability in diverse benchmarking scenarios, I propose enhancing its configurability options.

Proposed Enhancements

  1. Dynamic Iteration and Budget Settings: Allow users to specify the number of iterations and budget time for each benchmark test, enabling finer control over the benchmarking process.

  2. System Infos: Add options to display system info such as the current CPU being used. This feature is particularly useful for understanding the context of the benchmarks.

  3. Custom Output Configuration: Provide more options for customizing the output of the benchmark results. This could include toggling between different levels of detail, formatting options, and the choice to output results in different formats (e.g., JSON, CSV).

  4. Advanced Warmup Control: Offer more control over the warmup phase, such as setting the warmup duration or even allowing custom warmup routines.

  5. Environment Variable Integration: Enable the configuration of benchmarks through environment variables, facilitating easier integration with different development and CI/CD environments.

Additional Considerations

  • Comptime Configurations: Utilize Zig's comptime capabilities for some configurations to optimize performance by determining settings at compile time.

  • Modular Design: Ensure the tool's design remains modular for easier maintenance and future extensions, separating concerns like data collection, output formatting, and configuration management.

  • Plugin System for Output Formatting: Consider a plugin system for output formats, allowing users to add custom formatters for scalability and flexibility.

  • Performance Implications: Monitor and minimize any performance overhead introduced by new features, maintaining Zig's efficiency.

  • Cross-platform Consistency: Ensure features like CPU information retrieval are implemented consistently across different operating systems.

Implementation

The enhancements could be integrated into the existing Config struct with additional fields and options. For instance:

pub const Config = struct {
    ...
    iterations: u16 = 10,
    budget: u64 = 2e9, // 2 seconds
    display_system_infor: bool = false,
    output_format: enum { Standard, JSON, CSV } = .Standard,
    ...
};
@hendriknielaender
Copy link
Owner Author

#46 display_system_info done. Next i will add an output, for extensions like JSON, CSV etc.

@hendriknielaender
Copy link
Owner Author

close this since most of this is already implemented, and opened a new issue for the output config. #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant