Skip to content

Commit d6254f2

Browse files
committed
doc: doc comment in the optimize crate
1 parent 7b50fcf commit d6254f2

File tree

1 file changed

+11
-0
lines changed
  • src/typegraph/optimize/src

1 file changed

+11
-0
lines changed

src/typegraph/optimize/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
22
// SPDX-License-Identifier: MPL-2.0
33

4+
/**
5+
* This crate implement the optimization step for the serialized typegraph.
6+
* It runs in three steps.
7+
* - Step 1: We run the Kosaraju's algorithm to partition the graph (only the
8+
* type related vertices) into strongly connected components.
9+
* - Step 2: We assign a bucket for each type, according to its hash. The
10+
* hash function does not currently try to deduplicate types that belong
11+
* in a strongly connected component of size larger than one.
12+
* - Step 3: To each bucket is assigned a type index, then we translate all
13+
* the type references in the typegraph into the new type indices.
14+
*/
415
mod dedup;
516
mod kosaraju;
617

0 commit comments

Comments
 (0)