Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update values for Vertex #791

Merged
merged 8 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pages/fundamentals/storage-memory-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ Each `Delta` object has a least **56B**.

{<h4> <code>Vertex</code> memory layout </h4>}

Each `Vertex` object has at least **112B** + **56B** for the `Delta` object, in
total, a minimum of **168B**.
Each `Vertex` object has at least **88B** + **56B** for the `Delta` object, in
total, a minimum of **144B**.

Each additional label takes **4B**.

Expand Down Expand Up @@ -578,7 +578,7 @@ Let's assume the name on average has $3\text{B}+10\text{B} = 13\text{B}$ (each
name is on average 10 characters long). One the average values are included, the
calculation is:

$19,148 \times (112\text{B} + 13\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 19,148 \times 213\text{B} = 4,078,524\text{B}.$
$19,148 \times (88\text{B} + 13\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 19,148 \times 189\text{B} = 3,618,972\text{B}.$

The remaining 2,584 vertices are the `ComicSeries` vertices with the `title` and
`publishYear` properties. Let's assume that the `title` property is
Expand All @@ -590,9 +590,9 @@ list occupies $3 \times 2\text{B} \times 2\text{B} = 12\text{B}$. Using the same
formula as above, but being careful to include both `title` and `publishYear`
properties, the calculation is:

$2584 \times (112\text{B} + 13\text{B} + 12\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 2584 \times 225\text{B} = 581,400\text{B}.$
$2584 \times (88\text{B} + 13\text{B} + 12\text{B} + 16\text{B} + 16\text{B} + 56\text{B}) = 2584 \times 201\text{B} = 519,384\text{B}.$

In total, $4,659,924\text{B}$ to store vertices.
In total, $4,138,356\text{B}$ to store vertices.

The edges don't have any properties on them, so the formula is as follows:

Expand Down Expand Up @@ -626,7 +626,7 @@ $3 \times 21,723 \times (80\text{B}+13\text{B}+16\text{B})= 65,169 \times 109\te

Now let's sum up everything we calculated:

$4,659,924\text{B} + 87,416,704\text{B} + 2,606,760\text{B} + 7,103,421\text{B} = 101,786,809 \text{B} \approx 102\text{MB}.$
$4,138,356\text{B} + 87,416,704\text{B} + 2,606,760\text{B} + 7,103,421\text{B} = 101,265,241 \text{B} \approx 99\text{MB}.$

Bear in mind the number can vary because objects can have higher overhead due to
the additional data.
Expand Down