@cloudbitmaps/roaring 0.14.0 → 0.15.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/dist/index.d.ts CHANGED
@@ -136,14 +136,17 @@ export interface CacheOptions {
136
136
  /**
137
137
  * Ceiling on how many segments' `.crbm` readers (each holding a parsed index) the store keeps open at once
138
138
  * (default 1024) — the steady-state memory bound for a long-running server that reads across many segments.
139
- * Past it the least-recently-used segment's reader is evicted; re-opening it later is one cheap tail GET.
139
+ * Past it the least-recently-used segment's reader is evicted; re-opening it later is one cheap tail GET. A reader of a small generation, one whose whole object came with its tail read,
140
+ * also holds its chunk bytes, so a read of it makes no chunk request until the reader is evicted or the pointer refresh
141
+ * moves it on; a store with no timed refresh (`genTtlMs: 0`, or no registry) keeps none.
140
142
  * Applies whenever the store builds its own read path — a backend or a bare `IStorageDriver`. A pre-built
141
143
  * `StorageChunkSource` manages its own reader cache.
142
144
  */
143
145
  readonly readerMax?: number;
144
146
  /**
145
- * Aggregate byte ceiling on what the open readers hold, their parsed `.crbm` indices and the metadata a
146
- * generation carries (default 64 MiB) — the byte half
147
+ * Aggregate byte ceiling on what the open readers hold, their parsed `.crbm` indices, the metadata a
148
+ * generation carries, and the chunk bytes a reader keeps when its tail read returned a whole object whose chunks
149
+ * total at most this ceiling divided by {@link CacheOptions.readerMax} (default 64 MiB) — the byte half
147
150
  * of the memory bound, complementing the {@link CacheOptions.readerMax} *count* bound. A wide/dense segment's
148
151
  * parsed index can reach about 1.3 MB, so a count-only bound could let the open readers pin over a GB and blow a small
149
152
  * heap (e.g. a 128 MB Lambda); this evicts the least-recently-used reader once the summed index footprint
@@ -959,11 +962,15 @@ export declare class CloudRoaring {
959
962
  */
960
963
  export interface BaseCombineOptions extends IdRange {
961
964
  /**
962
- * Max chunk keys resolved concurrently — bounds the Storage footprint (about `concurrency × operands` chunks in
963
- * flight). A positive integer; default 32. The window opens 8 keys wide (or `concurrency`, if lower) and widens
964
- * as keys are taken, so a read that stops early fetches no more than a few keys ahead; one that runs to the end
965
- * spends nearly all of its round trips at the full width. A read that stops early has requested up to
966
- * `concurrency` keys per operand past the last one it used.
965
+ * How far ahead each operand is read: a positive integer, default 32. The library's own stores read each operand as
966
+ * one stream of coalesced ranges (chunks that sit near each other are one request), and `concurrency` is how many
967
+ * range requests a stream holds ahead of the read, in flight or landed and not yet used. So about
968
+ * `concurrency × operands` requests are in flight at most, and, since a range is at most 1 MiB (one chunk, when a chunk
969
+ * is larger), about `concurrency × operands` MiB are held, whatever the segment's size. The stream opens 4 ranges wide
970
+ * (or `concurrency`, if lower) and widens as ranges are taken, so a read that stops early has asked for little past
971
+ * where it stopped, and a read that fits one range makes one request however many chunks it needs. A source that
972
+ * reads chunk by chunk (a custom one) is read as before: `concurrency` chunk keys at once, opening 8 wide. A running
973
+ * stream holds its operand's reader outside the reader cache's bounds until it ends or the segment moves on.
967
974
  */
968
975
  readonly concurrency?: number;
969
976
  /** Override the store's per-op denial-of-wallet budget for this call (`false` lifts it). */
@@ -1318,8 +1325,9 @@ export declare class Segment {
1318
1325
  /**
1319
1326
  * Chunk-skipping intersection: stream the ids in **this** segment AND every segment in `others`, ascending.
1320
1327
  * Fetches only the Storage chunks present in *all* operands (a key absent from any operand contributes nothing
1321
- * and is never downloaded), streaming under a bounded in-flight window — so the Storage footprint stays small
1322
- * (Lambda-friendly) regardless of segment size. Pass `concurrency` to tune that window (a positive integer, 32 by default).
1328
+ * and is never downloaded), reading each operand's as coalesced ranges under a bounded in-flight window — so the Storage
1329
+ * footprint stays small (Lambda-friendly) regardless of segment size. Pass `concurrency` to tune that window (the range
1330
+ * requests held ahead per operand: a positive integer, 32 by default).
1323
1331
  * AND is commutative, so `a.intersect([b])` and `b.intersect([a])` yield the same ids. Pass `budget` to
1324
1332
  * override the store's per-op denial-of-wallet budget for this call (or `false` to lift it).
1325
1333
  */
package/dist/index.js CHANGED
@@ -1983,8 +1983,9 @@ var Segment = class _Segment {
1983
1983
  /**
1984
1984
  * Chunk-skipping intersection: stream the ids in **this** segment AND every segment in `others`, ascending.
1985
1985
  * Fetches only the Storage chunks present in *all* operands (a key absent from any operand contributes nothing
1986
- * and is never downloaded), streaming under a bounded in-flight window — so the Storage footprint stays small
1987
- * (Lambda-friendly) regardless of segment size. Pass `concurrency` to tune that window (a positive integer, 32 by default).
1986
+ * and is never downloaded), reading each operand's as coalesced ranges under a bounded in-flight window — so the Storage
1987
+ * footprint stays small (Lambda-friendly) regardless of segment size. Pass `concurrency` to tune that window (the range
1988
+ * requests held ahead per operand: a positive integer, 32 by default).
1988
1989
  * AND is commutative, so `a.intersect([b])` and `b.intersect([a])` yield the same ids. Pass `budget` to
1989
1990
  * override the store's per-op denial-of-wallet budget for this call (or `false` to lift it).
1990
1991
  */