Skip to content

Research/logger improvements#92

Merged
webcoderspeed merged 4 commits into
mainfrom
research/logger-improvements
Jun 10, 2026
Merged

Research/logger improvements#92
webcoderspeed merged 4 commits into
mainfrom
research/logger-improvements

Conversation

@webcoderspeed

Copy link
Copy Markdown
Collaborator

Pull Request

📋 Description

What does this PR do?

Why is this change needed?

Related Issues

  • Fixes #
  • Related to #

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧹 Code cleanup/refactoring
  • ⚡ Performance improvement
  • 🧪 Test improvements
  • 🔧 Build/CI improvements

🧪 Testing

Test Coverage

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change manually

Test Details

# Commands used for testing
npm test
npm run test:coverage
npm run lint

Manual Testing

📖 Documentation

  • Code comments updated
  • README.md updated
  • API documentation updated
  • Examples updated
  • CHANGELOG.md updated (for significant changes)

🔍 Code Quality

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have run the linter and fixed any issues

📦 Dependencies

  • No new dependencies added
  • New dependencies are justified and documented
  • Dependencies are pinned to specific versions
  • Security implications have been considered

🚀 Performance

  • No performance impact
  • Performance impact is minimal and justified
  • Performance improvements included
  • Benchmarks provided (if applicable)

🔒 Security

  • No security implications
  • Security implications have been considered and addressed
  • No sensitive data exposed
  • Input validation added where necessary

📱 Compatibility

  • Node.js versions:
  • Operating Systems:
  • Breaking changes documented
  • Migration guide provided (if needed)

🎃 Hacktoberfest

  • This is a Hacktoberfest contribution
  • I have read and followed the contribution guidelines
  • This PR provides meaningful value (not spam)
  • I understand the project's goals and scope

📸 Screenshots/Examples

Before

After

Code Example

// Example of how to use the new feature
import { Logixia } from 'logixia';

const logger = new Logixia({
  // example configuration
});

// example usage

🔗 Additional Context

Deployment Notes

Rollback Plan

Future Considerations

✅ Reviewer Checklist

  • Code quality meets project standards
  • Tests are comprehensive and pass
  • Documentation is updated and clear
  • Breaking changes are properly documented
  • Security implications reviewed
  • Performance impact acceptable
  • Ready for merge

📝 Notes for Reviewers

🙏 Acknowledgments


Thank you for contributing to Logixia! 🚀

webcoderspeed and others added 4 commits June 11, 2026 02:47
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>
…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>
@webcoderspeed webcoderspeed merged commit 43dc990 into main Jun 10, 2026
2 of 4 checks passed
@webcoderspeed webcoderspeed deleted the research/logger-improvements branch June 10, 2026 21:43
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
ESM (gzipped) 15.05 KB (0%)
CJS (gzipped) 15.12 KB (0%)

@github-actions

Copy link
Copy Markdown

🎉 This issue has been resolved in version 1.11.1.
Install it: npm install logixia@1.11.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant