[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / world/changelog/changeLogCost

# world/changelog/changeLogCost

## Type Aliases

### ChangeLogCost

> **ChangeLogCost** = `object`

Defined in: [packages/prismarine/src/world/changelog/changeLogCost.ts:9](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/changelog/changeLogCost.ts#L9)

What one sealed tick costs the change log, in counts rather than time, for reporting
through `reportProgress`.

#### Properties

##### blockBytes

> `readonly` **blockBytes**: `number`

Defined in: [packages/prismarine/src/world/changelog/changeLogCost.ts:17](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/changelog/changeLogCost.ts#L17)

The estimated bytes of those entries, part of `bytes`.

##### blockEntries

> `readonly` **blockEntries**: `number`

Defined in: [packages/prismarine/src/world/changelog/changeLogCost.ts:15](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/changelog/changeLogCost.ts#L15)

How many of the entries are block or block entity field entries.

##### bytes

> `readonly` **bytes**: `number`

Defined in: [packages/prismarine/src/world/changelog/changeLogCost.ts:13](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/changelog/changeLogCost.ts#L13)

An estimate of the bytes the entries hold, from [estimatePlainBytes](#estimateplainbytes).

##### entries

> `readonly` **entries**: `number`

Defined in: [packages/prismarine/src/world/changelog/changeLogCost.ts:11](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/changelog/changeLogCost.ts#L11)

The number of entries the tick appended.

## Functions

### changeLogCost()

> **changeLogCost**(`sealed`): [`ChangeLogCost`](#changelogcost)

Defined in: [packages/prismarine/src/world/changelog/changeLogCost.ts:26](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/changelog/changeLogCost.ts#L26)

Counts one sealed tick's entries and estimates their bytes. The result depends only on the
entries, so it is the same on every host.

#### Parameters

##### sealed

[`SealedTick`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/changelog/ChangeLog/index.md#sealedtick)

The tick to count.

#### Returns

[`ChangeLogCost`](#changelogcost)

Its entry count and estimated bytes, in all and for blocks.

***

### estimatePlainBytes()

> **estimatePlainBytes**(`value`): `number`

Defined in: [packages/prismarine/src/world/changelog/changeLogCost.ts:50](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/changelog/changeLogCost.ts#L50)

Estimates the payload bytes of a plain value: 8 for a number or bigint, 1 for a boolean,
nothing for null, 2 for each UTF-16 code unit of a string or property name, the byte length
of a typed array, and the sum of the parts for an array or object.

It is a logical size for comparing ticks and changes, not the heap size an engine allocates.

#### Parameters

##### value

[`PlainData`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/changelog/PlainData/index.md#plaindata)

The value to measure.

#### Returns

`number`

Its estimated size in bytes.
