@pulseindex/sdk 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### The covering threshold, corrected against a real app
6
+
7
+ `withinRadius` is a pre-filter the caller narrows exactly afterwards, so excess
8
+ area is cheaper than predicates. 4.0.0's threshold was too strict: it rejected
9
+ the coarse cell at 5 km, turning a 10-cell covering into 167. Measured through
10
+ the sibling PHP SDK against a real application with 100,000 properties, a 5 km
11
+ radius went from 3,082 µs to 926 µs on wall time — the cost is the request, not
12
+ the search.
13
+
14
+ The coarse cell is now taken up to 3.0× the circle, which still rejects it at
15
+ 2 km where it wastes 4.73× to 6.91×. Both SDKs are regenerated against one
16
+ shared vector fixture, so they still agree cell for cell.
17
+
3
18
  ## 4.0.0
4
19
 
5
20
  **A major, not a minor.** The previous draft of these notes said 3.2.0. Checking
package/dist/index.d.mts CHANGED
@@ -402,11 +402,17 @@ declare class GeoHash {
402
402
  * How much area outside the circle a covering may carry before a finer
403
403
  * precision is worth its cell count.
404
404
  *
405
- * 2.0 is where the measured choices come out right at every radius: it
406
- * rejects the coarse cell at 2 km (6.91x) and 5 km (2.76x) and accepts it at
407
- * 15 km (1.44x), which is also where the cell count turns from 47 into 1,120.
405
+ * `withinRadius` is a pre-filter the caller narrows exactly afterwards, so
406
+ * excess area is cheaper than predicates.
407
+ *
408
+ * 2.0 was the first attempt and it was too strict. It rejected the coarse
409
+ * cell at 5 km, so a covering that had cost 10 cells cost 167, and the demo
410
+ * benchmark went from beating PostgreSQL to losing to it by 2.76x on wall
411
+ * time — the cost is the request, not the search. 3.0 keeps the cheap
412
+ * covering at 5 km (2.76x) and still rejects the coarse cell at 2 km, where
413
+ * it wastes 4.73x to 6.91x depending on latitude.
408
414
  */
409
- static readonly ACCEPTABLE_COVER_RATIO = 2;
415
+ static readonly ACCEPTABLE_COVER_RATIO = 3;
410
416
  private static readonly NEIGHBORS;
411
417
  private static readonly BORDERS;
412
418
  static encode(lat: number, lon: number, precision?: number): string;
package/dist/index.d.ts CHANGED
@@ -402,11 +402,17 @@ declare class GeoHash {
402
402
  * How much area outside the circle a covering may carry before a finer
403
403
  * precision is worth its cell count.
404
404
  *
405
- * 2.0 is where the measured choices come out right at every radius: it
406
- * rejects the coarse cell at 2 km (6.91x) and 5 km (2.76x) and accepts it at
407
- * 15 km (1.44x), which is also where the cell count turns from 47 into 1,120.
405
+ * `withinRadius` is a pre-filter the caller narrows exactly afterwards, so
406
+ * excess area is cheaper than predicates.
407
+ *
408
+ * 2.0 was the first attempt and it was too strict. It rejected the coarse
409
+ * cell at 5 km, so a covering that had cost 10 cells cost 167, and the demo
410
+ * benchmark went from beating PostgreSQL to losing to it by 2.76x on wall
411
+ * time — the cost is the request, not the search. 3.0 keeps the cheap
412
+ * covering at 5 km (2.76x) and still rejects the coarse cell at 2 km, where
413
+ * it wastes 4.73x to 6.91x depending on latitude.
408
414
  */
409
- static readonly ACCEPTABLE_COVER_RATIO = 2;
415
+ static readonly ACCEPTABLE_COVER_RATIO = 3;
410
416
  private static readonly NEIGHBORS;
411
417
  private static readonly BORDERS;
412
418
  static encode(lat: number, lon: number, precision?: number): string;
package/dist/index.js CHANGED
@@ -65,11 +65,17 @@ var GeoHash = class {
65
65
  * How much area outside the circle a covering may carry before a finer
66
66
  * precision is worth its cell count.
67
67
  *
68
- * 2.0 is where the measured choices come out right at every radius: it
69
- * rejects the coarse cell at 2 km (6.91x) and 5 km (2.76x) and accepts it at
70
- * 15 km (1.44x), which is also where the cell count turns from 47 into 1,120.
68
+ * `withinRadius` is a pre-filter the caller narrows exactly afterwards, so
69
+ * excess area is cheaper than predicates.
70
+ *
71
+ * 2.0 was the first attempt and it was too strict. It rejected the coarse
72
+ * cell at 5 km, so a covering that had cost 10 cells cost 167, and the demo
73
+ * benchmark went from beating PostgreSQL to losing to it by 2.76x on wall
74
+ * time — the cost is the request, not the search. 3.0 keeps the cheap
75
+ * covering at 5 km (2.76x) and still rejects the coarse cell at 2 km, where
76
+ * it wastes 4.73x to 6.91x depending on latitude.
71
77
  */
72
- static ACCEPTABLE_COVER_RATIO = 2;
78
+ static ACCEPTABLE_COVER_RATIO = 3;
73
79
  static NEIGHBORS = {
74
80
  n: ["p0r21436x8zb9dcf5h7kjnmqesgutwvy", "bc01fg45238967deuvhjyznpkmstqrwx"],
75
81
  s: ["14365h7k9dcfesgujnmqp0r2twvyx8zb", "238967debc01fg45kmstqrwxuvhjyznp"],
package/dist/index.mjs CHANGED
@@ -42,11 +42,17 @@ var GeoHash = class {
42
42
  * How much area outside the circle a covering may carry before a finer
43
43
  * precision is worth its cell count.
44
44
  *
45
- * 2.0 is where the measured choices come out right at every radius: it
46
- * rejects the coarse cell at 2 km (6.91x) and 5 km (2.76x) and accepts it at
47
- * 15 km (1.44x), which is also where the cell count turns from 47 into 1,120.
45
+ * `withinRadius` is a pre-filter the caller narrows exactly afterwards, so
46
+ * excess area is cheaper than predicates.
47
+ *
48
+ * 2.0 was the first attempt and it was too strict. It rejected the coarse
49
+ * cell at 5 km, so a covering that had cost 10 cells cost 167, and the demo
50
+ * benchmark went from beating PostgreSQL to losing to it by 2.76x on wall
51
+ * time — the cost is the request, not the search. 3.0 keeps the cheap
52
+ * covering at 5 km (2.76x) and still rejects the coarse cell at 2 km, where
53
+ * it wastes 4.73x to 6.91x depending on latitude.
48
54
  */
49
- static ACCEPTABLE_COVER_RATIO = 2;
55
+ static ACCEPTABLE_COVER_RATIO = 3;
50
56
  static NEIGHBORS = {
51
57
  n: ["p0r21436x8zb9dcf5h7kjnmqesgutwvy", "bc01fg45238967deuvhjyznpkmstqrwx"],
52
58
  s: ["14365h7k9dcfesgujnmqp0r2twvyx8zb", "238967debc01fg45kmstqrwxuvhjyznp"],
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@pulseindex/sdk",
3
- "version": "4.0.0",
4
- "description": "Official Node.js & TypeScript SDK for PulseIndex — hosted search and filtering for large entity sets",
3
+ "version": "4.0.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/mohammed-alfarra/pulseindex-js.git"
7
+ },
8
+ "description": "Official Node.js & TypeScript SDK for PulseIndex \u2014 hosted search and filtering for large entity sets",
5
9
  "license": "MIT",
6
10
  "author": "PulseIndex",
7
11
  "keywords": [