Skip to content

refactor: updated and refactored for esm using latest npm libraries #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timint
Copy link

@timint timint commented Jul 12, 2025

Leaving this library better than I found it.

  • Refactored for ESM
  • Updated and solved vulnerable dependencies
  • Updated build tools to latest config standards
  • Polished and modernized code where needed
  • Updated all tests to conform with new code

Benchmark results BEFORE:

Started: lookup
tangerine.lookup POST with caching using Cloudflare x 81.31 ops/sec ±195.93% (76 runs sampled)
tangerine.lookup POST without caching using Cloudflare x 155 ops/sec ±3.50% (70 runs sampled)
tangerine.lookup GET with caching using Cloudflare x 229,002 ops/sec ±2.29% (80 runs sampled)
tangerine.lookup GET without caching using Cloudflare x 200 ops/sec ±1.01% (77 runs sampled)
dns.promises.lookup with caching using Cloudflare x 9,104,364 ops/sec ±2.17% (77 runs sampled)
dns.promises.lookup without caching using Cloudflare x 4,753 ops/sec ±5.24% (72 runs sampled)
Fastest without caching is: dns.promises.lookup without caching using Cloudflare

Started: resolve
tangerine.resolve POST with caching using Cloudflare x 566 ops/sec ±195.91% (76 runs sampled)
tangerine.resolve POST without caching using Cloudflare x 178 ops/sec ±1.25% (75 runs sampled)
tangerine.resolve GET with caching using Cloudflare x 1,246,098 ops/sec ±1.70% (82 runs sampled)
tangerine.resolve GET without caching using Cloudflare x 173 ops/sec ±1.08% (71 runs sampled)
tangerine.resolve POST with caching using Google x 1,251,376 ops/sec ±1.57% (78 runs sampled)
tangerine.resolve POST without caching using Google x 107 ops/sec ±1.17% (75 runs sampled)
tangerine.resolve GET with caching using Google x 1,255,991 ops/sec ±2.21% (77 runs sampled)
tangerine.resolve GET without caching using Google x 110 ops/sec ±1.94% (80 runs sampled)
resolver.resolve with caching using Cloudflare x 7,586,061 ops/sec ±2.98% (71 runs sampled)
resolver.resolve without caching using Cloudflare x 206 ops/sec ±1.93% (72 runs sampled)
Fastest without caching is: resolver.resolve without caching using Cloudflare

Started: reverse
tangerine.reverse GET with caching x 553 ops/sec ±195.53% (73 runs sampled)
tangerine.reverse GET without caching x 195 ops/sec ±1.58% (74 runs sampled)
resolver.reverse with caching x 7,890,730 ops/sec ±3.13% (72 runs sampled)
resolver.reverse without caching x 202 ops/sec ±1.57% (69 runs sampled)
dns.promises.reverse with caching x 8,517,471 ops/sec ±1.42% (75 runs sampled)
dns.promises.reverse without caching x 205 ops/sec ±1.38% (71 runs sampled)
Fastest without caching is: dns.promises.reverse without caching, resolver.reverse without caching

Benchmark results AFTER:

Started: lookup
tangerine.lookup POST with caching using Cloudflare x 584 ops/sec ±195.45% (73 runs sampled)
tangerine.lookup POST without caching using Cloudflare x 182 ops/sec ±1.79% (73 runs sampled)
tangerine.lookup GET with caching using Cloudflare x 224,403 ops/sec ±1.46% (83 runs sampled)
tangerine.lookup GET without caching using Cloudflare x 186 ops/sec ±1.28% (70 runs sampled)
dns.promises.lookup with caching using Cloudflare x 9,039,409 ops/sec ±4.04% (73 runs sampled)
dns.promises.lookup without caching using Cloudflare x 4,767 ops/sec ±5.99% (73 runs sampled)
Fastest without caching is: dns.promises.lookup without caching using Cloudflare

Started: resolve
tangerine.resolve POST with caching using Cloudflare x 664 ops/sec ±195.89% (79 runs sampled)
tangerine.resolve POST without caching using Cloudflare x 202 ops/sec ±1.88% (71 runs sampled)
tangerine.resolve GET with caching using Cloudflare x 1,226,500 ops/sec ±1.50% (79 runs sampled)
tangerine.resolve GET without caching using Cloudflare x 180 ops/sec ±1.35% (75 runs sampled)
tangerine.resolve POST with caching using Google x 1,212,057 ops/sec ±1.55% (81 runs sampled)
tangerine.resolve POST without caching using Google x 111 ops/sec ±1.98% (72 runs sampled)
tangerine.resolve GET with caching using Google x 1,197,579 ops/sec ±2.44% (78 runs sampled)
tangerine.resolve GET without caching using Google x 111 ops/sec ±0.62% (78 runs sampled)
resolver.resolve with caching using Cloudflare x 7,879,187 ops/sec ±2.90% (74 runs sampled)
resolver.resolve without caching using Cloudflare x 215 ops/sec ±1.42% (76 runs sampled)
Fastest without caching is: resolver.resolve without caching using Cloudflare

Started: reverse
tangerine.reverse GET with caching x 619 ops/sec ±195.69% (78 runs sampled)
tangerine.reverse GET without caching x 198 ops/sec ±1.17% (76 runs sampled)
resolver.reverse with caching x 8,534,229 ops/sec ±1.67% (77 runs sampled)
resolver.reverse without caching x 212 ops/sec ±1.40% (75 runs sampled)
dns.promises.reverse with caching x 8,404,110 ops/sec ±1.74% (76 runs sampled)
dns.promises.reverse without caching x 211 ops/sec ±1.22% (73 runs sampled)
Fastest without caching is: resolver.reverse without caching, dns.promises.reverse without caching

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant