Skip to content

Adopt bitsets (major breaking changes)#10

Open
RandomHashTags wants to merge 13 commits intomainfrom
adopt-bitsets
Open

Adopt bitsets (major breaking changes)#10
RandomHashTags wants to merge 13 commits intomainfrom
adopt-bitsets

Conversation

@RandomHashTags
Copy link
Owner

@RandomHashTags RandomHashTags commented Mar 8, 2026

Use bit sets where possible (for game days, times, locations, entry ids) as a drop-in replacement for heap allocated solutions in an effort improve schedule generation performance (and throughput), mentioned in #3 . Using @_specialized is unfortunately required since it performs horribly without it.

Fixes #5 .

A lot of the data structure had to be updated to support this change and we fallback to the heap allocated solutions for odd-ball schedules.

Other changes this PR contains:

  • removes a lot of public facing code that should have never been (left over from legacy code)
  • moves some code into their own files
  • conforms some types to noncopyable
  • LeagueGenerationResult no longer contains the id and settings values
  • removes some conformances (or moves them to the unit test module)

~45% throughput increase over #9 with no change to the failure rate.

- this commit replaces the `Set<LeagueTimeIndex` and `Set<LeagueLocationIndex` with the new bit set
- refactors to fully support bitsets
- removed some code
- moved some code to their own files
- bitset fixes and performance improvements
- removed `public` visibility from a lot of stuff since they aren't meant to be available (left over from legacy code)
@RandomHashTags RandomHashTags self-assigned this Mar 8, 2026
@RandomHashTags RandomHashTags added enhancement New feature or request semver/major Semantic Version MAJOR changes (made incompatible API changes) unit tests Relates to unit tests in some way performance Relates to performance labels Mar 8, 2026
@RandomHashTags
Copy link
Owner Author

RandomHashTags commented Mar 9, 2026

Shouldn't merge until Swift 6.3 is released because it contains a compilation error (only when building in release mode) fix for SILFunctionTransform "CopyPropagation" that these changes hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request performance Relates to performance semver/major Semantic Version MAJOR changes (made incompatible API changes) swift 6.3 unit tests Relates to unit tests in some way

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore bit sets

1 participant