Skip to content

v1.3.0 - Performance & API Enhancement (2026-03-03)

Choose a tag to compare

@cybergodev cybergodev released this 03 Mar 12:08
· 21 commits to main since this release
7911402

Added

  • LinkFormat configuration for inline link formatting (markdown, html, none)
  • CacheCleanup configuration with automatic background cleanup for TTL entries
  • StartCleanup() and StopCleanup() methods for proactive cache management
  • SetPoolLogger() function for pool corruption debug logging
  • Optional variadic configuration parameters for New() constructor
  • Smart config merging for ExtractConfig and LinkExtractionConfig
  • Automatic cache goroutine cleanup via runtime.SetFinalizer
  • Len() method to get current cache entry count
  • FromFile variant methods to Extractor and LinkExtractor interfaces

Changed

  • WalkNodes converted from recursive to iterative (prevents stack overflow on deep DOM)
  • isPureASCII optimized with 64-bit batch processing (16% CPU hotspot reduced)
  • Cache key hash length increased from 8 to 16 bytes (better collision resistance)
  • Cache.Get() uses read-write lock separation for better concurrent performance
  • ExtractToMarkdown() now uses DefaultConfig() for API consistency
  • DefaultScorer uses lazy initialization with sync.Once
  • Examples restructured from 9 to 8 focused files

Fixed

  • Potential cache goroutine leak when Cache is garbage collected
  • TOCTOU race condition in Cache.Get() method
  • Potential nil pointer dereference in NewDefaultScorerWithConfig()
  • Goroutine leak in withTimeout() with maximum limit protection
  • Test error handling issues (unchecked errors, nil pointer access)

Performance

  • Extract: ~26% faster
  • ExtractWithCache: ~34% faster
  • ExtractLargeDocument: ~22% faster
  • CleanText: ~68% faster (replaced regex with manual scanning)
  • ConcurrentExtract: ~29% faster
  • Memory allocations reduced by 50-65% in key benchmarks

Security

  • Library confirmed fully thread-safe (100+ race detection iterations)
  • All shared state properly synchronized with appropriate primitives

Breaking Changes

  • Destructive update!