kindlings-runtime-perf

Optimize runtime performance of macro-generated type class instances with semiEval config evaluation and typed locals.

68|7|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/kubuszok/kindlings --skill kindlings-runtime-perf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kindlings-runtime-perf
Source: https://github.com/kubuszok/kindlings/tree/main/docs/contributing/kindlings-runtime-perf
Command: npx skills add https://github.com/kubuszok/kindlings --skill kindlings-runtime-perf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Runtime performance bottlenecks in macro-generated type class derivations for Scala projects, leading to slow compilation and degraded runtime efficiency. This skill provides patterns to accelerate codegen and inlining to speed up derived codecs and schemas.

Core Features & Use Cases

  • Compile-time config evaluation with semiEval to reduce per-field runtime checks.
  • Typed local variables via ValDefs to avoid boxing of primitives during decoding.
  • SENTINEL loop patterns and inline encoding/decoding for built-in types to minimize indirection.
  • Inline collection loops and map handling to remove runtime helpers and lambdas.
  • Position-based access for structured formats like Avro to avoid string key lookups.
  • Cache expensive computations at instance scope to avoid repetition during each encode/decode call.

Quick Start

Apply runtime performance optimizations to your macro-derived codecs by enabling compile-time config evaluation and inlining of encoders/decoders.

Frequently Asked Questions about kindlings-runtime-perf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize runtime performance of macro-derived type class instances in Scala?

You can optimize macro-derived type class instances by enabling compile-time config evaluation with semiEval and applying inline encoding patterns to minimize allocations and maximize inlining across derivation modules.

Why do my Scala macro-generated codecs suffer from runtime performance bottlenecks?

Runtime bottlenecks in macro-generated codecs often stem from per-field runtime checks and primitive boxing; applying typed local variables via ValDefs and inline collection loops removes these indirections and lambda allocations.

What is the best way to reduce allocations during Scala macro derivation codegen?

The best way to reduce allocations during codegen is implementing SENTINEL loop patterns and position-based access for structured formats, which removes runtime helpers and avoids string key lookups during decode calls.

Does this runtime optimization approach require a specific Scala derivation workflow?

Yes, these optimization patterns require a Scala and Hearth-based derivation workflow to function, relying on benchmarks referenced in performance regression analysis documentation to validate the actual speed gains.

Can I use inline encoding and decoding to speed up built-in type handling in Scala?

Yes, applying inline encoding and decoding patterns for built-in types minimizes indirection within macro-derived codecs, while caching expensive computations at instance scope avoids repetition during each encode and decode call.