Understand the accuracy vs. speed trade-offs
mainThis package is optimized for speed and small bundle size, making it ideal for browser environments or high-throughput applications. However, it trades off accuracy due to the lossy compression required for its small footprint.
Comparison with geo-tz
| Feature | @photostructure/tz-lookup | geo-tz |
|---|---|---|
| Size | ~72kb (10x smaller) | ~892kb |
| Speed | ~0.05ms per lookup (100x faster) | ~5ms per lookup |
| Accuracy | ~30% error rate on random points; ~10% on inhabited areas; ~5% if considering offset equivalence | High accuracy |
Recommendation: If high accuracy is critical and you are running in a Node.js environment, use geo-tz instead.