Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

serialization-performance

/serialization-performance

Zmniejsza koszt CPU i bajtów serializacji obiektów przez dobór formatu, ponowne użycie schematów i buforów oraz unikanie kopiowania.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Zmniejsza koszt CPU i bajtów serializacji obiektów przez dobór formatu, ponowne użycie schematów i buforów oraz unikanie kopiowania.

Oryginalny opis (EN)

Cut the CPU and bytes spent turning objects into wire or disk format by choosing the right format, reusing schemas and buffers, and avoiding copies. Use when serialization shows up in the profile, payloads are large, or encode/decode latency dominates a hot request path.

Jak działa

  1. Method
  2. Litmus tests
  3. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 51 linii, 412 słów
Podgląd SKILL.md
---
name: serialization-performance
description: Cut the CPU and bytes spent turning objects into wire or disk format by choosing the right format, reusing schemas and buffers, and avoiding copies. Use when serialization shows up in the profile, payloads are large, or encode/decode latency dominates a hot request path.
---

# Serialization performance

Every service that crosses a process boundary pays to encode and decode, and on
a hot path that cost can rival the work itself. JSON is readable and slow;
binary formats are fast and opaque. The wins come from choosing the format for
the job, reusing the expensive setup, and not copying bytes you could read in
place.

## Method

1. **Measure encode and decode separately.** Profile both directions on real
   payloads; decode is often the more expensive half. Confirm serialization is a
   genuine share of the request, not a rounding error you are about to
   over-engineer.
2. **Match the format to the boundary.** Human-facing or debug APIs can afford
   JSON. High-volume internal RPC wants a schema binary format: Protobuf or
   Cap'n Proto for RPC, Avro for data pipelines, MessagePack for a compact
   JSON-shaped drop-in. Pick for throughput and payload size, not familiarity.
3. **Reuse schemas, codecs, and parsers.** Compile the Protobuf descriptor, Avro
   schema, or JSON schema once and hold it; recompiling per call is pure waste.
   Reuse a configured encoder (a pooled encoder, a `TSerializer`) rather than
   constructing one per message.
4. **Reuse buffers to cut allocation.** Encode into a pooled or preallocated
   byte buffer (`sync.Pool`, a reused `bytes.Buffer`, a scratch array) so a
   high-QPS path does not allocate and free a fresh buffer per message and feed
   the collector.
5. **Read in place with zero-copy where the format allows.** Flatbuffers and
   Cap'n Proto let you access fields with no parse step; memory-mapped Arrow and
   read-only byte views avoid copying large blobs. Slice or view the underlying
   bytes instead of duplicating them into new objects.
6. **Serialize only what the consumer needs.** Trim fields the reader ignores,
   project columns for a columnar format, and stream a large collection
   record-by-record instead of building one giant in-memory document. Fewer
   bytes encoded is less CPU and less GC.

## Litmus tests

- Was the format chosen from measured throughput and size, not defaulted to
  JSON?
- Is the schema or codec compiled once and reused, not rebuilt per call?
- Does a high-QPS encoder reuse buffers instead of allocating per message?
- For large payloads, do you view bytes in place rather than copy them?

## Boundaries

This covers turning objects into bytes and back. Compressing those bytes after
encoding, and picking the codec, is compression-tradeoffs; reducing the number
of round trips that carry them is io-optimization. Schema evolution and
versioning are the format's own contract, not a performance question.

Wersje

W bazie nie ma innych skilli o nazwie serialization-performance.

Migawka bazy z 13.11.2026 · wersja paczki 865371edc1e5 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100io-optimization
    Zmniejsza koszt wejścia i wyjścia przez ograniczenie liczby round tripów, przesyłanych bajtów i zamianę dostępu losowego na sekwencyjny w obciążeniach ograniczonych przez IO.
  • 100stj-serialization-optimizer
    Optymalizuje System.Text.Json w .NET: konteksty generowane źródłowo, ponowne użycie opcji, strumieniowanie i ograniczanie alokacji.
  • 100fluent-serializer
    Doradza przy konfigurowalnych potokach serializacji w .NET: opakowanie System.Text.Json lub Newtonsoft.Json fluent API, własne profile, konfiguracja konwencji i presety wielokrotnego użytku.
  • 100serde-code-review
    Sprawdza kod serializacji serde w Rust: wzorce derive, reprezentacje enumów, własne implementacje i typowe błędy serializacji w serde_json, toml i innych formatach.
  • 100hyperion
    Pomaga używać Hyperion, wydajnego serializatora polimorficznego dla .NET, do serializacji komunikatów aktorów Akka.NET, grafów obiektów z cyklami i szybkiej serializacji binarnej.
  • 90kotlin-serialization-wire-contract
    Statycznie sprawdza bezpieczeństwo kontraktu kotlinx.serialization i ewolucję schematu: encodeDefaults, explicitNulls, ignoreUnknownKeys, polimorfizm sealed i to, czy zmiana jest addytywna czy łamiąca.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.