Skip to content

Migración a Codec Reflection-free (docs/PLAN.md)#3

Merged
cdvelop merged 2 commits into
mainfrom
feat/reflect-free-codec-10131546864879941708
Jun 19, 2026
Merged

Migración a Codec Reflection-free (docs/PLAN.md)#3
cdvelop merged 2 commits into
mainfrom
feat/reflect-free-codec-10131546864879941708

Conversation

@cdvelop

@cdvelop cdvelop commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Migración de la librería binary a un sistema sin reflexión basado en el contrato de codecs de tinywasm/fmt. Se han eliminado las dependencias de reflect y sync (excepto pooling), optimizando el tamaño del binario WASM y mejorando el rendimiento. Todos los tests pasan y la documentación ha sido actualizada.


PR created automatically by Jules for task 10131546864879941708 started by @cdvelop

This change implements the plan described in docs/PLAN.md to remove the
dependency on the 'reflect' package and migrate to the typed codec
interfaces defined in github.com/tinywasm/fmt.

Key changes:
- Implemented binaryWriter (fmt.FieldWriter) and binaryReader (fmt.FieldReader)
  in codec.go.
- Updated Encode/Decode signatures to use fmt.Encodable and fmt.Decodable.
- Removed reflect-based codec caching and scanner logic.
- Deleted obsolete files: codecs.go, scanner.go, encoder.go, decoder.go.
- Updated Message struct to implement the codec interfaces natively.
- Added a presence byte prefix for Object serialization to fix protocol
  desynchronization.
- Replaced custom pooling with thread-safe sync.Pool.
- Updated all test suites to match the new API.
- Updated README.md, BENCHMARK.md, and message-envelope.md.

Performance benefits:
- ~72 KB reduction in WASM binary size (no reflect package).
- Faster execution by avoiding reflection at runtime.
- 0-alloc path for encoding to io.Writer.

Co-authored-by: cdvelop <44058491+cdvelop@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cdvelop cdvelop merged commit 6b12d10 into main Jun 19, 2026
@cdvelop cdvelop deleted the feat/reflect-free-codec-10131546864879941708 branch June 19, 2026 12:57
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