Migración a Codec Reflection-free (docs/PLAN.md)#3
Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Migración de la librería
binarya un sistema sin reflexión basado en el contrato de codecs detinywasm/fmt. Se han eliminado las dependencias dereflectysync(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