A static analyzer for Go that recommends struct field rearrangements to maximize memory allocation efficiency.
structslop is a static analyzer for Go that identifies inefficient struct field ordering and suggests rearrangements to optimize memory allocation. It analyzes struct layouts to minimize padding and fit fields into smaller memory size classes, reducing overall memory usage and improving cache performance in Go applications.
Go developers working on performance-sensitive applications, systems programming, or large-scale codebases where memory efficiency is critical.
Developers choose structslop because it provides actionable, automated recommendations for struct memory optimization directly integrated into Go tooling, helping reduce memory overhead without manual layout analysis.
structslop is a static analyzer for Go that recommends struct field rearrangements to provide for maximum space/allocation efficiency.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works like other Go analyzers, allowing easy invocation on packages or files without additional setup, as shown in the usage examples with standard Go tool commands.
Outputs clear comparisons showing current and optimal sizes, size classes, and percentage savings, directly tied to Go runtime allocation behavior for practical insights.
Prioritizes real-world memory efficiency by considering Go size classes, ensuring recommendations lead to actual allocation reductions rather than just byte savings.
The `-apply` flag automatically rewrites source code with suggested field orders, reducing manual refactoring effort and speeding up optimization workflows.
Without the `-verbose` flag, the tool only reports savings, missing insights on structs already in optimal size classes, which limits transparency in some cases.
Automatic field rearrangement with `-apply` can disrupt code that relies on specific struct layouts for serialization, reflection, or C interop, requiring manual review.
The README has a 'TODO' in the Contributing section, suggesting gaps in documentation that may hinder community engagement or advanced usage.