Skip to content

Commit

Permalink
Change structlayout packing to take less memory
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Nov 12, 2023
1 parent 23a2293 commit a3bef79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Simulator/Effects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Craftimizer.Simulator;

[StructLayout(LayoutKind.Auto)]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public record struct Effects
{
public byte InnerQuiet;
Expand Down
2 changes: 1 addition & 1 deletion Simulator/SimulationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Craftimizer.Simulator;

[StructLayout(LayoutKind.Auto)]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public record struct SimulationState
{
public readonly SimulationInput Input;
Expand Down
2 changes: 1 addition & 1 deletion Solver/SimulationNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Craftimizer.Solver;

[StructLayout(LayoutKind.Auto)]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SimulationNode
{
public readonly SimulationState State;
Expand Down

1 comment on commit a3bef79

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: a3bef79 Previous: 3edb156 Ratio
Craftimizer.Benchmark.Bench.Solve(State: 5372D31C98FA4C357F54029912394B0F5ECBE94AEC9D12C1C2B7F453C62ACD2F, Config: E1C895829E5BB1533C41D3C71AD65B6B3E1A60B5EE2D35A845744C251E71EFA5) 1458388307.142857 ns (± 4084876.9457907476)
Craftimizer.Benchmark.Bench.Solve(State: 5372D31C98FA4C357F54029912394B0F5ECBE94AEC9D12C1C2B7F453C62ACD2F, Config: E1C895829E5BB1533C41D3C71AD65B6B3E1A60B5EE2D35A845744C251E71EFA5) 1051332766.6666666 ns (± 10778631.173475115)
Craftimizer.Benchmark.Bench.Solve(State: 99B0F1AD46A18B4D8262F9BA75ABE23507217C2F20FBF895A49282DDFEF50190, Config: E1C895829E5BB1533C41D3C71AD65B6B3E1A60B5EE2D35A845744C251E71EFA5) 1513468557.142857 ns (± 2203168.0356719485)
Craftimizer.Benchmark.Bench.Solve(State: 99B0F1AD46A18B4D8262F9BA75ABE23507217C2F20FBF895A49282DDFEF50190, Config: E1C895829E5BB1533C41D3C71AD65B6B3E1A60B5EE2D35A845744C251E71EFA5) 1120738614.2857144 ns (± 2132210.6364620165)

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.