Comptime is a .NET source generator that executes methods at compile time and serializes their results into C# code. By marking methods with the `[Comptime]` attribute, developers can shift expensive computations from runtime to build time, improving application performance. It supports primitive types, collections, method parameters with constant expressions, and generic methods. The tool uses C# interceptors to replace method calls with pre-computed values, requiring .NET 8.0+ and C# 12+. Methods must be static, classes must be partial, and return types must be immutable.
Table of contents
OverviewFeaturesUsageRequirementsInstallationHow It WorksDiagnosticsLimitationsLicenseSort: