Skip to content

feat(typia): performance optimization.#1851

Merged
samchon merged 3 commits into
masterfrom
feat/optimize
May 14, 2026
Merged

feat(typia): performance optimization.#1851
samchon merged 3 commits into
masterfrom
feat/optimize

Conversation

@samchon
Copy link
Copy Markdown
Owner

@samchon samchon commented May 14, 2026

This pull request introduces several improvements and refactorings to the Typia native adapter and metadata handling, focusing on performance optimizations, extensibility, and improved JSDoc tag extraction. The most significant changes include the addition of caching for import identifier substitutions, enhanced JSDoc tag extraction (including type expressions), and a more extensible analyzer system for metadata comment tags. There are also notable refactorings in the call expression transformation logic to support more precise handling of known module/method pairs.

Performance and Caching Improvements

  • Added a thread-safe cache (sync.Map) for commonJSImportIdentifierSubstitutions to avoid redundant computation of import identifier substitutions per source file, improving performance when processing large codebases. [1] [2]

Metadata and JSDoc Tag Extraction Enhancements

  • Improved extraction of JSDoc tags by including type expression texts (e.g., parameter types, typedefs) in the metadata, allowing for richer schema generation and analysis. [1] [2]
  • Updated the metadata comment tag iteration logic to invoke a pluggable MetadataCommentTagAnalyzer function, enabling custom analyzers and better separation of concerns. [1] [2] [3]

Call Expression Transformation Refactoring

  • Refactored the call expression transformation logic to distinguish between generic and "known" transformations, enabling more precise handling of module/method pairs and simplifying the functor lookup mechanism. [1] [2] [3] [4]

Miscellaneous

  • Added missing import for nativescanner in MetadataHelper.go, required for extracting type expression texts.

These changes collectively improve the maintainability, extensibility, and efficiency of the Typia codebase, particularly in areas related to TypeScript AST processing and metadata extraction.

@samchon samchon self-assigned this May 14, 2026
@samchon samchon added the enhancement New feature or request label May 14, 2026
@samchon samchon marked this pull request as ready for review May 14, 2026 01:47
Copilot AI review requested due to automatic review settings May 14, 2026 01:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Typia’s native adapter and metadata/JSDoc handling, while also bumping workspace package versions and the ttsc catalog dependency.

Changes:

  • Adds cached CommonJS import identifier substitutions and known call-expression transformation paths.
  • Wires metadata comment tag analysis and extracts JSDoc type-expression text.
  • Bumps package versions to 13.0.0-dev.20260514 and ttsc to ^0.10.2.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/typia/native/adapter/imports.go Adds CommonJS substitution cache.
packages/typia/native/adapter/adapter.go Uses known module/method transform path.
packages/typia/native/transform/CallExpressionTransformer.go Adds TransformKnown and cached functor map.
packages/typia/native/core/factories/MetadataFactory.go Wires comment tag analyzer.
packages/typia/native/core/factories/internal/metadata/MetadataHelper.go Extracts JSDoc type expressions.
packages/typia/native/core/factories/internal/metadata/iterate_metadata_comment_tags.go Applies metadata comment tags to properties.
packages/typia/native/core/factories/internal/metadata/IMetadataIteratorProps.go Adds comment tag analyzer hook type.
pnpm-workspace.yaml Updates ttsc catalog version.
pnpm-lock.yaml Locks ttsc and optional binaries to 0.10.2.
package.json Bumps root version.
benchmark/package.json Bumps package version.
config/package.json Bumps package version.
examples/package.json Bumps package version.
packages/interface/package.json Bumps package version.
packages/langchain/package.json Bumps package version.
packages/mcp/package.json Bumps package version.
packages/typia/package.json Bumps package version.
packages/utils/package.json Bumps package version.
packages/vercel/package.json Bumps package version.
tests/debug/package.json Bumps package version.
tests/template/package.json Bumps package version.
tests/test-error/package.json Bumps package version.
tests/test-langchain/package.json Bumps package version.
tests/test-mcp/package.json Bumps package version.
tests/test-typia-automated/package.json Bumps package version.
tests/test-typia-generate/package.json Bumps package version.
tests/test-typia-schema/package.json Bumps package version.
tests/test-utils-automated/package.json Bumps package version.
tests/test-utils/package.json Bumps package version.
tests/test-vercel/package.json Bumps package version.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/typia/native/adapter/imports.go
@samchon samchon merged commit 7973c84 into master May 14, 2026
11 checks passed
@samchon samchon deleted the feat/optimize branch May 14, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants