Skip to content

Conversation

@krodak
Copy link
Member

@krodak krodak commented Dec 23, 2025

Overview

This PR adds performance benchmarks for Swift structs, similar to the existing enum benchmarks.
Also added some class equivalents for direct struct vs class comparison.

Benchmark Coverage

Structs:

  • SimpleStruct - 5 fields (String, Int, Bool, Float, Double)
  • Address - 3 fields (strings + int)
  • Person - nested struct with optional
  • ComplexStruct - 6 fields

Classes (for comparison with structs):

  • SimpleClass - equivalent to SimpleStruct
  • AddressClass - equivalent to Address

Results

Struct Benchmarks

node run.js --adaptive --filter=StructRoundtrip

CleanShot 2025-12-23 at 19 06 44@2x

Struct vs Class Comparison

node run.js --adaptive '--filter=/Simple|Address/'

CleanShot 2025-12-23 at 19 04 57@2x

@krodak krodak self-assigned this Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant