@loro-dev/flock 4.4.1 → 4.4.2

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/src/index.ts CHANGED
@@ -992,13 +992,21 @@ export class Flock {
992
992
  }
993
993
 
994
994
  merge(other: Flock): void {
995
+ this.eventBatcher.beforeImport();
995
996
  merge(this.inner, other.inner);
996
997
  }
997
998
 
998
999
  /**
999
1000
  * Returns the exclusive version vector, which only includes peers that have
1000
- * at least one entry in the current state. This is consistent with the state
1001
- * after export and re-import.
1001
+ * at least one entry in the current state.
1002
+ *
1003
+ * Complexity: O(M + V log M + R (log L + log S)).
1004
+ * - M = memtablePeerCount
1005
+ * - V = vvPeerCount
1006
+ * - L = memtableLen
1007
+ * - R = scanned candidate rows in KV_BY_PEER_CLOCK
1008
+ * - S = storage key count in KV_BY_KEY
1009
+ * No full O(memtableSize) pre-scan is performed.
1002
1010
  *
1003
1011
  * Use this version when sending to other peers for incremental sync.
1004
1012
  */
@@ -1077,6 +1085,7 @@ export class Flock {
1077
1085
  }
1078
1086
 
1079
1087
  private importJsonInternal(bundle: ExportBundle): ImportReport {
1088
+ this.eventBatcher.beforeImport();
1080
1089
  const report = import_json_ffi(this.inner, bundle) as
1081
1090
  | RawImportReport
1082
1091
  | undefined;
@@ -1126,6 +1135,7 @@ export class Flock {
1126
1135
  }
1127
1136
 
1128
1137
  importJsonStr(bundle: string): ImportReport {
1138
+ this.eventBatcher.beforeImport();
1129
1139
  const report = import_json_str_ffi(this.inner, bundle) as
1130
1140
  | RawImportReport
1131
1141
  | undefined;