# US 2026/0099310 A1 · Wasm bytecode optimization methods, execution methods, computer devices, and storage media

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0099310 A1
- Document ID: US20260099310A1
- Status: Published application
- Kind: A1
- Application number: 19/416,429
- Filed: 2025-12-11
- Published: 2026-04-09
- Earliest claimed: 2023-07-24
- Assignees: Ant Blockchain Technology (Shanghai) Co., Ltd.
- Applicants: Ant Blockchain Technology (Shanghai) Co., Ltd.
- Inventors: Wei ZHOU; Lei ZHANG
- Web page: https://patentgrep.com/patent/US20260099310A1

## CPC

- G06F 8/443: {Optimisation}
- G06F 8/4434: {Reducing the memory space required by the program code}
- G06F 9/4552: {Involving translation to a different instruction set architecture, e.g. just-in-time translation in a JVM}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Computer-implemented methods, systems and computer-readable media for WebAssembly (Wasm) bytecode optimization and execution are provided. An example method includes reading and parsing Wasm bytecode, to obtain a Wasm module object; creating a linear memory and filling the linear memory based on the Wasm module object obtained through parsing; executing a start function in the Wasm module object, compressing execution result data of the start function, and modifying the linear memory based on the compressed execution result; replacing a corresponding data segment in the Wasm module object with data in a modified linear memory; and encoding a Wasm module obtained by replacing the data segment, and storing the encoded Wasm module as Wasm bytecode.

## Claims

### Claim 1

A computer-implemented method for WebAssembly (Wasm) bytecode optimization, comprising:
reading and parsing first Wasm bytecode, to obtain a Wasm module object;
creating a linear memory and filling the linear memory based on the Wasm module object obtained through parsing;
executing a start function in the Wasm module object;
compressing execution result data of the start function to obtain a compressed execution result;
modifying the linear memory based on the compressed execution result;
replacing a corresponding data segment in the Wasm module object with data in a modified linear memory;
encoding a Wasm module obtained by replacing the data segment to obtain an encoded Wasm module; and
storing the encoded Wasm module as second Wasm bytecode.

### Claim 2 (depends on 1)

The computer-implemented method according to claim 1, wherein the compressing comprises one or more of encoding compression, dictionary compression, run-length encoding, transform compression, or prediction compression.

### Claim 3 (depends on 1)

The computer-implemented method according to claim 1, wherein before the encoding, the computer-implemented method further comprises: removing the start function from the Wasm module object.

### Claim 4 (depends on 1)

The computer-implemented method according to claim 1, wherein the compressing comprises using a three-segment structure (offset, length, value), wherein the offset represents a start location, the length represents a length, and the value represents a value.

### Claim 5 (depends on 4)

The computer-implemented method according to claim 4, wherein continuously repeated values or structures are represented by omitting three-segment structures at such locations.

### Claim 6 (depends on 5)

The computer-implemented method according to claim 5, wherein the continuously repeated values comprise continuously repeated integers.

### Claim 7 (depends on 1)

The computer-implemented method according to claim 1, comprising:
reading and parsing the second Wasm bytecode, to obtain a second Wasm module object;
creating a second linear memory and filling the second linear memory based on the second Wasm module object obtained through parsing; and
executing code in a code segment in the second Wasm module object.

### Claim 8 (depends on 7)

The computer-implemented method according to claim 7, wherein the reading and parsing the second Wasm bytecode, to obtain a second Wasm module object comprises:
reading and parsing the second Wasm bytecode, and storing, through decompression, compressed data comprised in the second Wasm bytecode, to obtain the second Wasm module object.

### Claim 9

A computer-implemented system, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform operations comprising:
reading and parsing first Wasm bytecode, to obtain a Wasm module object;
creating a linear memory and filling the linear memory based on the Wasm module object obtained through parsing;
executing a start function in the Wasm module object;
compressing execution result data of the start function to obtain a compressed execution result;
modifying the linear memory based on the compressed execution result;
replacing a corresponding data segment in the Wasm module object with data in a modified linear memory;
encoding a Wasm module obtained by replacing the data segment to obtain an encoded Wasm module; and
storing the encoded Wasm module as second Wasm bytecode.

### Claim 10 (depends on 9)

The computer-implemented system according to claim 9, wherein the compressing comprises one or more of encoding compression, dictionary compression, run-length encoding, transform compression, or prediction compression.

### Claim 11 (depends on 9)

The computer-implemented system according to claim 9, wherein before the encoding, the operations further comprise: removing the start function from the Wasm module object.

### Claim 12 (depends on 9)

The computer-implemented system according to claim 9, wherein the compressing comprises using a three-segment structure (offset, length, value), wherein the offset represents a start location, the length represents a length, and the value represents a value.

### Claim 13 (depends on 12)

The computer-implemented system according to claim 12, wherein continuously repeated values or structures are represented by omitting three-segment structures at such locations.

### Claim 14 (depends on 13)

The computer-implemented system according to claim 13, wherein the continuously repeated values comprise continuously repeated integers.

### Claim 15 (depends on 9)

The computer-implemented system according to claim 9, wherein the operations comprise:
reading and parsing the second Wasm bytecode, to obtain a second Wasm module object;
creating a second linear memory and filling the second linear memory based on the second Wasm module object obtained through parsing; and
executing code in a code segment in the second Wasm module object.

### Claim 16

One or more non-transitory computer storage media storing computer program instructions that when executed by one or more computers cause the one or more computers to perform operations comprising:
reading and parsing first Wasm bytecode, to obtain a Wasm module object;
creating a linear memory and filling the linear memory based on the Wasm module object obtained through parsing;
executing a start function in the Wasm module object;
compressing execution result data of the start function to obtain a compressed execution result;
modifying the linear memory based on the compressed execution result;
replacing a corresponding data segment in the Wasm module object with data in a modified linear memory;
encoding a Wasm module obtained by replacing the data segment to obtain an encoded Wasm module; and
storing the encoded Wasm module as second Wasm bytecode.

### Claim 17 (depends on 16)

The one or more non-transitory computer storage media according to claim 16, wherein the compressing comprises one or more of encoding compression, dictionary compression, run-length encoding, transform compression, or prediction compression.

### Claim 18 (depends on 16)

The one or more non-transitory computer storage media according to claim 16, wherein before the encoding, the operations further comprises: removing the start function from the Wasm module object.

### Claim 19 (depends on 16)

The one or more non-transitory computer storage media according to claim 16, wherein the compressing comprises using a three-segment structure (offset, length, value), wherein the offset represents a start location, the length represents a length, and the value represents a value.

### Claim 20 (depends on 19)

The one or more non-transitory computer storage media according to claim 19, wherein continuously repeated values or structures are represented by omitting three-segment structures at such locations.
