# \#serialization

**URL:** https://forums.swift.org/tag/serialization/483.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [What happened to \`Data(rawCapacity:)\` initializer?](https://forums.swift.org/t/what-happened-to-data-rawcapacity-initializer/83156)

<div class="topic-metadata">

**Author:** [@craigwrong](https://forums.swift.org/u/craigwrong)\
**Replies:** 5\
**Last updated:** [August 31, 2026, 5:02pm UTC](https://forums.swift.org/t/what-happened-to-data-rawcapacity-initializer/83156 "2026-08-31T17:02:57Z")

</div>

Greetings! Trying to understand how to work with output spans. I noticed this WWDC session showcases the use of: let pixelData = Data(rawCapacity: totalBytes) { outputSpan in Which does not seem to exist in Foundatio…

---

## [\[Pitch\] SARIF Support for Swift Diagnostics](https://forums.swift.org/t/pitch-sarif-support-for-swift-diagnostics/85513)

<div class="topic-metadata">

**Author:** [@aviralgoel](https://forums.swift.org/u/aviralgoel)\
**Replies:** 2\
**Last updated:** [July 6, 2026, 8:18pm UTC](https://forums.swift.org/t/pitch-sarif-support-for-swift-diagnostics/85513 "2026-07-06T20:18:12Z")

</div>

Hello Swift Forums! :waving\_hand: This is a pitch for introducing support in the Swift compiler for serializing Swift diagnostics to the Static Analysis Results Interchange Format (SARIF) v2.1.0, a standardized JSON-bas…

---

## [Swift needs a clean way to serialize model variants (e.g., exclude sound settings when syncing game state via iCloud)](https://forums.swift.org/t/swift-needs-a-clean-way-to-serialize-model-variants-e-g-exclude-sound-settings-when-syncing-game-state-via-icloud/81724)

<div class="topic-metadata">

**Author:** [@Amir\_Michail](https://forums.swift.org/u/Amir_Michail)\
**Replies:** 0\
**Last updated:** [August 20, 2025, 3:17pm UTC](https://forums.swift.org/t/swift-needs-a-clean-way-to-serialize-model-variants-e-g-exclude-sound-settings-when-syncing-game-state-via-icloud/81724 "2025-08-20T15:17:07Z")

</div>

In a game, you might want to serialize the game state both to disk and to iCloud, but exclude the sound settings from iCloud so that device-specific settings aren’t overwritten when syncing across devices. There are var…

---

## [Flatbuffers & Flexbuffers](https://forums.swift.org/t/flatbuffers-flexbuffers/77908)

<div class="topic-metadata">

**Author:** [@mustiikhalil](https://forums.swift.org/u/mustiikhalil)\
**Replies:** 0\
**Last updated:** [February 16, 2025, 1:35pm UTC](https://forums.swift.org/t/flatbuffers-flexbuffers/77908 "2025-02-16T13:35:59Z")

</div>

FlatBuffers is an efficient cross platform serialization library for C++, C#, C, Go, Java, Kotlin, JavaScript, Lobster, Lua, TypeScript, PHP, Python, Rust and Swift. It was originally created at Google for game developme…

---

## [AnyCodable Efficacy](https://forums.swift.org/t/anycodable-efficacy/49055)

<div class="topic-metadata">

**Author:** [@filip-sakel](https://forums.swift.org/u/filip-sakel)\
**Replies:** 10\
**Last updated:** [December 22, 2023, 1:27pm UTC](https://forums.swift.org/t/anycodable-efficacy/49055 "2023-12-22T13:27:39Z")

</div>

Hello, Swift community! I was playing around with Codable type-erasure types and realized that Codable doesn't have a proper type-erasure container, e.g. AnyCodable. So I played around with the idea and came up with an…

---

## [Memory leak using swift JSONEncoder. serialized data is still left in app's memory after logout \[iOS\]](https://forums.swift.org/t/memory-leak-using-swift-jsonencoder-serialized-data-is-still-left-in-apps-memory-after-logout-ios/66102)

<div class="topic-metadata">

**Author:** [@vigdora](https://forums.swift.org/u/vigdora)\
**Replies:** 10\
**Last updated:** [July 13, 2023, 8:41am UTC](https://forums.swift.org/t/memory-leak-using-swift-jsonencoder-serialized-data-is-still-left-in-apps-memory-after-logout-ios/66102 "2023-07-13T08:41:10Z")

</div>

I run memory dump on my app's memory and find out that it still holds some critical data that was not supposed to stay there after logout. (note: I have generated the memory dump while in debug mode). after some …

---

## [Converting Class objects into Data to serialise as .dat file](https://forums.swift.org/t/converting-class-objects-into-data-to-serialise-as-dat-file/62127)

<div class="topic-metadata">

**Author:** [@Simon](https://forums.swift.org/u/Simon)\
**Replies:** 28\
**Last updated:** [February 20, 2023, 2:18am UTC](https://forums.swift.org/t/converting-class-objects-into-data-to-serialise-as-dat-file/62127 "2023-02-20T02:18:02Z")

</div>

Hi everyone, I am trying to convert a class object into Data and then serialise it into a dat file, and then be able to convert the .dat file back into data and then back into an object to use. I have been working with…

---

## [High performance serialization format seriously lacking](https://forums.swift.org/t/high-performance-serialization-format-seriously-lacking/44609)

<div class="topic-metadata">

**Author:** [@benjamin.g](https://forums.swift.org/u/benjamin.g)\
**Replies:** 5\
**Last updated:** [February 10, 2021, 7:05pm UTC](https://forums.swift.org/t/high-performance-serialization-format-seriously-lacking/44609 "2021-02-10T19:05:55Z")

</div>

Hi, i've recently been involved in a project requiring a pretty good level of performance regarding serialization (to & from local storage), and found myself stuck between a few walls trying to use swift : use a DB ma…
