---
title: "DeviceStatistics: interface in Runtime, TypeShade API"
description: "DeviceStatistics, an interface in Runtime. What a device counts of the arrays it made."
url: https://typeshade.dev/api/devicestatistics/
language: en
---

# `DeviceStatistics`

Interface in Runtime

What a device counts of the arrays it made.

`import type { DeviceStatistics } from 'typeshade'`
`import type { DeviceStatistics } from 'typeshade/runtime'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
interface DeviceStatistics {
  readonly live: number;
  readonly liveBytes: number;
  readonly pooledBytes: number;
  readonly allocations: number;
  readonly reuses: number;
  readonly uploadBytes: number;
  readonly readBytes: number;
  readonly variants: Readonly<Record<string, 'tree' | 'subgroup'>>;
}
```

## Description

The bytes are those of typed arrays.

## Instance properties

**`live` read only `number`**

The arrays the device made and has not freed, the pooled ones among them.

**`liveBytes` read only `number`**

**`pooledBytes` read only `number`**

The bytes of the released arrays kept for reuse.

**`allocations` read only `number`**

How many arrays `array()` made new.

**`reuses` read only `number`**

How many arrays `array()` took from the pool instead.

**`uploadBytes` read only `number`**

The bytes of the values `array(value)` was given.

**`readBytes` read only `number`**

The bytes `read()` of the device’s arrays returned.

**`variants` read only `Readonly<Record<string, 'tree' | 'subgroup'>>`**

The text the last kernel call of each function dispatched on WebGPU (change 0119), by the function’s name: `'subgroup'` for the subgroup variant, `'tree'` for the function’s own. A function whose face has no variant, and every call on another tier, is `'tree'`.

## Source

[`src/runtime/device.ts`, line 111](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/device.ts#L111), at commit af54ddad5
