@cloudbitmaps/roaring 0.13.0 → 0.14.0
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/README.md +1 -1
- package/dist/bin/export-segments.js +29 -10
- package/dist/bin/export-segments.js.map +2 -2
- package/dist/index.d.ts +34 -4
- package/dist/index.js +29 -10
- package/dist/index.js.map +2 -2
- package/dist/roaring-codec.d.ts +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ name.
|
|
|
71
71
|
|
|
72
72
|
Measured against real S3 in `us-east-1`, from inside the region, with the pointer in the same bucket as the data: the median cold `intersect`
|
|
73
73
|
of two 500,000-id segments sharing 100 of their 1,999 chunks made 204 GETs, **$81.60 per million**, requesting only
|
|
74
|
-
the shared chunks, and took
|
|
74
|
+
the shared chunks, and took 290.06 ms at the median from inside the region (run of 2026-10-04, whose client had 50 sockets; the client this release builds allows 128, and its effect is not measured). A segment's first `store.load()`
|
|
75
75
|
is **$11.60 per million**, pointer included, from its measured requests at list prices. A cold `count()` is one pointer read: it reads no payload and no object.
|
|
76
76
|
|
|
77
77
|
The trade is stated plainly. A membership check that misses the cache costs a ranged GET against object storage,
|
|
@@ -449,6 +449,10 @@ var SafeBitmap = class _SafeBitmap {
|
|
|
449
449
|
toArray() {
|
|
450
450
|
return this.bitmap.toArray();
|
|
451
451
|
}
|
|
452
|
+
/** The values as one fresh ascending `Uint32Array`, exported natively. */
|
|
453
|
+
toUint32Array() {
|
|
454
|
+
return this.bitmap.toUint32Array();
|
|
455
|
+
}
|
|
452
456
|
};
|
|
453
457
|
function bitmapAsLoadInput(input) {
|
|
454
458
|
return input instanceof RoaringBitmap32 ? { bitmap: input } : input;
|
|
@@ -1668,9 +1672,14 @@ var CloudRoaring = class _CloudRoaring {
|
|
|
1668
1672
|
return estimateCost(input);
|
|
1669
1673
|
}
|
|
1670
1674
|
};
|
|
1671
|
-
var
|
|
1672
|
-
|
|
1673
|
-
});
|
|
1675
|
+
var withBatches = (gen, batches) => Object.assign(gen, { batches });
|
|
1676
|
+
var failing = (err) => {
|
|
1677
|
+
const rejecting = () => ({ next: () => Promise.reject(err) });
|
|
1678
|
+
return {
|
|
1679
|
+
[Symbol.asyncIterator]: rejecting,
|
|
1680
|
+
batches: () => ({ [Symbol.asyncIterator]: rejecting })
|
|
1681
|
+
};
|
|
1682
|
+
};
|
|
1674
1683
|
var samePin = (a, b) => a === void 0 || b === void 0 ? a === b : a.generation === b.generation && a.fingerprint === b.fingerprint;
|
|
1675
1684
|
var twoPins = (a, b) => {
|
|
1676
1685
|
const one = (p) => p === void 0 ? "live" : `pinned at generation ${p.generation ?? "none"}`;
|
|
@@ -1689,6 +1698,8 @@ var readOptions = (options) => ({
|
|
|
1689
1698
|
var NO_SEGMENTS = [];
|
|
1690
1699
|
var EMPTY_IDS = {
|
|
1691
1700
|
async *[Symbol.asyncIterator]() {
|
|
1701
|
+
},
|
|
1702
|
+
async *batches() {
|
|
1692
1703
|
}
|
|
1693
1704
|
};
|
|
1694
1705
|
var KEEP_EVERY_GENERATION = Number.MAX_SAFE_INTEGER;
|
|
@@ -1944,7 +1955,9 @@ var Segment = class _Segment {
|
|
|
1944
1955
|
if (this.expired()) return EMPTY_IDS;
|
|
1945
1956
|
const range = options == null ? void 0 : rangeOf(options);
|
|
1946
1957
|
const none = range === void 0 || range.after === void 0 && range.through === void 0;
|
|
1947
|
-
|
|
1958
|
+
const { engine, ref } = this;
|
|
1959
|
+
const bounds = none ? void 0 : range;
|
|
1960
|
+
return withBatches(engine.iterate(ref, bounds), () => engine.iterateBatches(ref, bounds));
|
|
1948
1961
|
}
|
|
1949
1962
|
/**
|
|
1950
1963
|
* The options a combine hands the engine, read once, when it is called ({@link readOptions}), with the `exclude`
|
|
@@ -1994,7 +2007,9 @@ var Segment = class _Segment {
|
|
|
1994
2007
|
} catch (err) {
|
|
1995
2008
|
return failing(err);
|
|
1996
2009
|
}
|
|
1997
|
-
|
|
2010
|
+
const refs = [this.ref, ...others.map((o) => o.ref)];
|
|
2011
|
+
const opts = this.refsIn(options, exclude);
|
|
2012
|
+
return withBatches(engine.intersect(refs, opts), () => engine.intersectBatches(refs, opts));
|
|
1998
2013
|
}
|
|
1999
2014
|
/**
|
|
2000
2015
|
* Materialize `this ∩ others…` (minus `exclude`) as a **new generation of `dest`** — `dest`'s previous contents
|
|
@@ -2052,7 +2067,9 @@ var Segment = class _Segment {
|
|
|
2052
2067
|
} catch (err) {
|
|
2053
2068
|
return failing(err);
|
|
2054
2069
|
}
|
|
2055
|
-
|
|
2070
|
+
const refs = [this.ref, ...others.map((o) => o.ref)];
|
|
2071
|
+
const opts = this.refsIn(options, exclude);
|
|
2072
|
+
return withBatches(engine.union(refs, opts), () => engine.unionBatches(refs, opts));
|
|
2056
2073
|
}
|
|
2057
2074
|
/** Materialize `this ∪ others…` (minus `exclude`) as a **new generation of `dest`** — see {@link intersectInto}. */
|
|
2058
2075
|
async unionInto(dest, others, options) {
|
|
@@ -2091,10 +2108,12 @@ var Segment = class _Segment {
|
|
|
2091
2108
|
} catch (err) {
|
|
2092
2109
|
return failing(err);
|
|
2093
2110
|
}
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2111
|
+
const base = this.ref;
|
|
2112
|
+
const refs = excludes.map((o) => o.ref);
|
|
2113
|
+
const opts = options == null ? void 0 : readOptions(options);
|
|
2114
|
+
return withBatches(
|
|
2115
|
+
engine.andNot(base, refs, opts),
|
|
2116
|
+
() => engine.andNotBatches(base, refs, opts)
|
|
2098
2117
|
);
|
|
2099
2118
|
}
|
|
2100
2119
|
/** Materialize `this \ (excludes…)` as a **new generation of `dest`** — see {@link intersectInto}. */
|