Research/logger improvements#92
Merged
Merged
Conversation
Benchmarks: - Expand the core suite to 6 scenarios (simple, structured, error, child, deep-nested, high-cardinality) across pino, winston, bunyan (optional) AND logixia — both default and JSON mode. Writes to /dev/null for pure serialization/overhead timing. - Add benchmarks/features.mjs (npm run benchmark:features) for the distinctive APIs with no cross-library equivalent: wide events, safeStringify (BigInt + circular), decycle/retrocycle round-trip, adaptive-sampling decision, and namespace child logging. README: - Replace the stale/optimistic perf table with the real measured numbers and an honest read: logixia wins on error logging (+17%) and high-cardinality (+10%) vs pino, beats winston/bunyan everywhere with no tail-latency spikes, and trails pino on simple logs (pino's synchronous-write trade-off). Adds a feature-throughput table showing sampling/namespace overhead is ~µs. - Surface the new flagship features in the tagline and the comparison table (OTLP export, wide events, runtime reconfig, adaptive sampling). SEO: - Richer keyword-dense package.json description + keywords (40 → 79: wide-events, otlp, opentelemetry-logs, log-redaction, adaptive-sampling, runtime-log-level, observability, fastify, etc.). - Set 20 GitHub repo topics and an SEO-rich repo description (done via gh API). 900 tests pass; build + lint + typecheck green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…logixia into research/logger-improvements
…cenarios Profiling showed the per-log cost was dominated by avoidable async/allocation overhead, not real work. Fixes (all behavior-preserving — 906 tests green): - Synchronous write fast path: ConsoleTransport.write returns void (not Promise.resolve), TransportManager.write + writeToTransport stay synchronous when every transport completes synchronously (no Promise.allSettled, no microtask). A Promise is only created/awaited when a transport is genuinely async (DB/cloud/OTLP) — verified by a test that a real async transport is still awaited before the log call resolves. - Millisecond-cached timestamp: new Date().toISOString() (~2.2M ops/sec, the #1 hot-path tax) is computed once per ms and reused (Date.now() keyed cache). - Lazy formatting: formatLog() ran on every log and was thrown away when a transport manager was present (each transport formats itself). Now only the no-transport fallback / error path formats. - Skip the OTel bridge call + {} allocation + Object.keys when the bridge is off (_isOtelBridgeEnabled gate). Results (vs pino, /dev/null, Node 20): simple -14% (pino's synchronous-stdout home turf) structured +16% (was -33%) error +114% (was +17%) child +31% (was -30%) deep nested +17% (was -29%) high-card +58% (was +10%) p99 stays 1-3µs throughout (winston spiked to 3,038µs on high-cardinality). Adds hot-path correctness tests (sync write emits once, async transport still awaited, transport-throw falls back to direct write without rejecting, cached timestamp is valid ISO and advances). Updates the README perf table with the new measured numbers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
size-limit report 📦
|
|
🎉 This issue has been resolved in version 1.11.1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
📋 Description
What does this PR do?
Why is this change needed?
Related Issues
🔄 Type of Change
🧪 Testing
Test Coverage
Test Details
Manual Testing
📖 Documentation
🔍 Code Quality
📦 Dependencies
🚀 Performance
🔒 Security
📱 Compatibility
🎃 Hacktoberfest
📸 Screenshots/Examples
Before
After
Code Example
🔗 Additional Context
Deployment Notes
Rollback Plan
Future Considerations
✅ Reviewer Checklist
📝 Notes for Reviewers
🙏 Acknowledgments
Thank you for contributing to Logixia! 🚀