Skip to content

Expand structuredClone compatibility - #58735

Open
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D122156629
Open

rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D122156629

Conversation

@rubennorte

@rubennorte rubennorte commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary:
Compare React Native structuredClone behavior with ungap/structured-clone and port the applicable upstream coverage. Add support for ArrayBuffer, DataView, typed arrays, boxed BigInt values, Error subclasses, deeply cloned causes, and safe proto data properties. Serialization-only and JSON/lossy tests remain out of scope because React Native exposes a single-step cloning API.

The comparison dependency and benchmark cases were used only to collect the results below and are not shipped with React Native.

Before — React Native implementation before this change:

structuredClone (mode 🚀)

(index) Task name Latency avg (ns) Latency med (ns) Throughput avg (ops/s) Throughput med (ops/s) Samples
0 'clone a string' '338.62 ± 0.05%' '330.00 ± 9.00' '3014547 ± 0.05%' '3030303 ± 84962' 2953184
1 'clone a basic array' '1587.6 ± 10.36%' '1353.0 ± 19.00' '734465 ± 0.42%' '739098 ± 10235' 638616
2 'clone a basic object' '1344.2 ± 8.81%' '1172.0 ± 20.00' '828917 ± 0.33%' '853242 ± 14813' 743963
3 'clone a complex object' '3370.6 ± 0.60%' '3255.0 ± 40.00' '304183 ± 0.02%' '307220 ± 3822' 296680

After — React Native compared with ungap/structured-clone:

structuredClone (mode 🚀)

(index) Task name Latency avg (ns) Latency med (ns) Throughput avg (ops/s) Throughput med (ops/s) Samples
0 'React Native: clone a string' '348.44 ± 0.08%' '331.00 ± 1.00' '2927181 ± 0.04%' '3021148 ± 9155' 2869970
1 'ungap: clone a string' '2037.4 ± 11.17%' '1592.0 ± 50.00' '617833 ± 0.09%' '628141 ± 19947' 490832
2 'React Native: clone a basic array' '1460.2 ± 8.39%' '1282.0 ± 20.00' '775137 ± 0.42%' '780031 ± 12362' 684824
3 'ungap: clone a basic array' '5112.8 ± 0.81%' '4718.0 ± 111.00' '205586 ± 0.08%' '211954 ± 5107' 195589
4 'React Native: clone a basic object' '1373.8 ± 8.58%' '1152.0 ± 20.00' '842837 ± 0.46%' '868056 ± 15337' 727910
5 'ungap: clone a basic object' '8853.2 ± 0.76%' '8253.0 ± 141.00' '117562 ± 0.05%' '121168 ± 2106' 112954
6 'React Native: clone a complex object' '3539.4 ± 0.55%' '3456.0 ± 50.00' '288368 ± 0.02%' '289352 ± 4248' 282537
7 'ungap: clone a complex object' '21498 ± 0.72%' '20080 ± 301.00' '48208 ± 0.09%' '49801 ± 755' 46516

The benchmark shows no material regression in the existing implementation and React Native remains faster than ungap/structured-clone across all scenarios.

Changelog:
[General][Added] - Add ArrayBuffer, DataView, typed array, boxed BigInt, and Error subclass support to structuredClone

Reviewed By: javache

Differential Revision: D122156629

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 29, 2026
@meta-codesync

meta-codesync Bot commented Sep 29, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122156629.

@meta-codesync meta-codesync Bot changed the title Expand structuredClone compatibility and benchmarks Expand structuredClone compatibility and benchmarks (#58735) Sep 29, 2026
rubennorte added a commit to rubennorte/react-native that referenced this pull request Sep 29, 2026
Summary:

Compare React Native structuredClone with ungap/structured-clone (**used by Expo**) and port the applicable upstream coverage. Add support for ArrayBuffer, DataView, typed arrays, boxed BigInt values, Error subclasses, deeply cloned causes, and safe __proto__ data properties. Serialization-only and JSON/lossy tests remain out of scope because React Native exposes a single-step cloning API.

Add ungap/structured-clone as a devDependency and benchmark each existing Fantom scenario against it.

Before — React Native implementation before this change:

### structuredClone (mode 🚀) ###

| (index) | Task name                | Latency avg (ns)  | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ------------------------ | ----------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'clone a string'         | '338.62 ± 0.05%'  | '330.00 ± 9.00'  | '3014547 ± 0.05%'      | '3030303 ± 84962'      | 2953184 |
| 1       | 'clone a basic array'    | '1587.6 ± 10.36%' | '1353.0 ± 19.00' | '734465 ± 0.42%'       | '739098 ± 10235'       | 638616  |
| 2       | 'clone a basic object'   | '1344.2 ± 8.81%'  | '1172.0 ± 20.00' | '828917 ± 0.33%'       | '853242 ± 14813'       | 743963  |
| 3       | 'clone a complex object' | '3370.6 ± 0.60%'  | '3255.0 ± 40.00' | '304183 ± 0.02%'       | '307220 ± 3822'        | 296680  |

After — React Native compared with ungap/structured-clone:

### structuredClone (mode 🚀) ###

| (index) | Task name                              | Latency avg (ns)  | Latency med (ns)  | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------------------- | ----------------- | ----------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'React Native: clone a string'         | '348.44 ± 0.08%'  | '331.00 ± 1.00'   | '2927181 ± 0.04%'      | '3021148 ± 9155'       | 2869970 |
| 1       | 'ungap: clone a string'               | '2037.4 ± 11.17%' | '1592.0 ± 50.00'  | '617833 ± 0.09%'       | '628141 ± 19947'       | 490832  |
| 2       | 'React Native: clone a basic array'    | '1460.2 ± 8.39%'  | '1282.0 ± 20.00'  | '775137 ± 0.42%'       | '780031 ± 12362'       | 684824  |
| 3       | 'ungap: clone a basic array'          | '5112.8 ± 0.81%'  | '4718.0 ± 111.00' | '205586 ± 0.08%'       | '211954 ± 5107'        | 195589  |
| 4       | 'React Native: clone a basic object'   | '1373.8 ± 8.58%'  | '1152.0 ± 20.00'  | '842837 ± 0.46%'       | '868056 ± 15337'       | 727910  |
| 5       | 'ungap: clone a basic object'         | '8853.2 ± 0.76%'  | '8253.0 ± 141.00' | '117562 ± 0.05%'       | '121168 ± 2106'        | 112954  |
| 6       | 'React Native: clone a complex object' | '3539.4 ± 0.55%'  | '3456.0 ± 50.00'  | '288368 ± 0.02%'       | '289352 ± 4248'        | 282537  |
| 7       | 'ungap: clone a complex object'       | '21498 ± 0.72%'   | '20080 ± 301.00'  | '48208 ± 0.09%'        | '49801 ± 755'          | 46516   |

The benchmark shows no material regression in the existing implementation and React Native remains faster than ungap/structured-clone across all scenarios.

Changelog:
[General][Added] - Add ArrayBuffer, DataView, typed array, boxed BigInt, and Error subclass support to structuredClone

Differential Revision: D122156629
rubennorte added a commit to rubennorte/react-native that referenced this pull request Sep 29, 2026
Summary:

Compare React Native structuredClone with ungap/structured-clone (**used by Expo**) and port the applicable upstream coverage. Add support for ArrayBuffer, DataView, typed arrays, boxed BigInt values, Error subclasses, deeply cloned causes, and safe __proto__ data properties. Serialization-only and JSON/lossy tests remain out of scope because React Native exposes a single-step cloning API.

Add ungap/structured-clone as a devDependency and benchmark each existing Fantom scenario against it.

Before — React Native implementation before this change:

### structuredClone (mode 🚀) ###

| (index) | Task name                | Latency avg (ns)  | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ------------------------ | ----------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'clone a string'         | '338.62 ± 0.05%'  | '330.00 ± 9.00'  | '3014547 ± 0.05%'      | '3030303 ± 84962'      | 2953184 |
| 1       | 'clone a basic array'    | '1587.6 ± 10.36%' | '1353.0 ± 19.00' | '734465 ± 0.42%'       | '739098 ± 10235'       | 638616  |
| 2       | 'clone a basic object'   | '1344.2 ± 8.81%'  | '1172.0 ± 20.00' | '828917 ± 0.33%'       | '853242 ± 14813'       | 743963  |
| 3       | 'clone a complex object' | '3370.6 ± 0.60%'  | '3255.0 ± 40.00' | '304183 ± 0.02%'       | '307220 ± 3822'        | 296680  |

After — React Native compared with ungap/structured-clone:

### structuredClone (mode 🚀) ###

| (index) | Task name                              | Latency avg (ns)  | Latency med (ns)  | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------------------- | ----------------- | ----------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'React Native: clone a string'         | '348.44 ± 0.08%'  | '331.00 ± 1.00'   | '2927181 ± 0.04%'      | '3021148 ± 9155'       | 2869970 |
| 1       | 'ungap: clone a string'               | '2037.4 ± 11.17%' | '1592.0 ± 50.00'  | '617833 ± 0.09%'       | '628141 ± 19947'       | 490832  |
| 2       | 'React Native: clone a basic array'    | '1460.2 ± 8.39%'  | '1282.0 ± 20.00'  | '775137 ± 0.42%'       | '780031 ± 12362'       | 684824  |
| 3       | 'ungap: clone a basic array'          | '5112.8 ± 0.81%'  | '4718.0 ± 111.00' | '205586 ± 0.08%'       | '211954 ± 5107'        | 195589  |
| 4       | 'React Native: clone a basic object'   | '1373.8 ± 8.58%'  | '1152.0 ± 20.00'  | '842837 ± 0.46%'       | '868056 ± 15337'       | 727910  |
| 5       | 'ungap: clone a basic object'         | '8853.2 ± 0.76%'  | '8253.0 ± 141.00' | '117562 ± 0.05%'       | '121168 ± 2106'        | 112954  |
| 6       | 'React Native: clone a complex object' | '3539.4 ± 0.55%'  | '3456.0 ± 50.00'  | '288368 ± 0.02%'       | '289352 ± 4248'        | 282537  |
| 7       | 'ungap: clone a complex object'       | '21498 ± 0.72%'   | '20080 ± 301.00'  | '48208 ± 0.09%'        | '49801 ± 755'          | 46516   |

The benchmark shows no material regression in the existing implementation and React Native remains faster than ungap/structured-clone across all scenarios.

Changelog:
[General][Added] - Add ArrayBuffer, DataView, typed array, boxed BigInt, and Error subclass support to structuredClone

Differential Revision: D122156629
rubennorte added a commit to rubennorte/react-native that referenced this pull request Sep 29, 2026
Summary:

Compare React Native structuredClone with ungap/structured-clone (**used by Expo**) and port the applicable upstream coverage. Add support for ArrayBuffer, DataView, typed arrays, boxed BigInt values, Error subclasses, deeply cloned causes, and safe __proto__ data properties. Serialization-only and JSON/lossy tests remain out of scope because React Native exposes a single-step cloning API.

Add ungap/structured-clone as a devDependency and benchmark each existing Fantom scenario against it.

Before — React Native implementation before this change:

### structuredClone (mode 🚀) ###

| (index) | Task name                | Latency avg (ns)  | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ------------------------ | ----------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'clone a string'         | '338.62 ± 0.05%'  | '330.00 ± 9.00'  | '3014547 ± 0.05%'      | '3030303 ± 84962'      | 2953184 |
| 1       | 'clone a basic array'    | '1587.6 ± 10.36%' | '1353.0 ± 19.00' | '734465 ± 0.42%'       | '739098 ± 10235'       | 638616  |
| 2       | 'clone a basic object'   | '1344.2 ± 8.81%'  | '1172.0 ± 20.00' | '828917 ± 0.33%'       | '853242 ± 14813'       | 743963  |
| 3       | 'clone a complex object' | '3370.6 ± 0.60%'  | '3255.0 ± 40.00' | '304183 ± 0.02%'       | '307220 ± 3822'        | 296680  |

After — React Native compared with ungap/structured-clone:

### structuredClone (mode 🚀) ###

| (index) | Task name                              | Latency avg (ns)  | Latency med (ns)  | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------------------- | ----------------- | ----------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'React Native: clone a string'         | '348.44 ± 0.08%'  | '331.00 ± 1.00'   | '2927181 ± 0.04%'      | '3021148 ± 9155'       | 2869970 |
| 1       | 'ungap: clone a string'               | '2037.4 ± 11.17%' | '1592.0 ± 50.00'  | '617833 ± 0.09%'       | '628141 ± 19947'       | 490832  |
| 2       | 'React Native: clone a basic array'    | '1460.2 ± 8.39%'  | '1282.0 ± 20.00'  | '775137 ± 0.42%'       | '780031 ± 12362'       | 684824  |
| 3       | 'ungap: clone a basic array'          | '5112.8 ± 0.81%'  | '4718.0 ± 111.00' | '205586 ± 0.08%'       | '211954 ± 5107'        | 195589  |
| 4       | 'React Native: clone a basic object'   | '1373.8 ± 8.58%'  | '1152.0 ± 20.00'  | '842837 ± 0.46%'       | '868056 ± 15337'       | 727910  |
| 5       | 'ungap: clone a basic object'         | '8853.2 ± 0.76%'  | '8253.0 ± 141.00' | '117562 ± 0.05%'       | '121168 ± 2106'        | 112954  |
| 6       | 'React Native: clone a complex object' | '3539.4 ± 0.55%'  | '3456.0 ± 50.00'  | '288368 ± 0.02%'       | '289352 ± 4248'        | 282537  |
| 7       | 'ungap: clone a complex object'       | '21498 ± 0.72%'   | '20080 ± 301.00'  | '48208 ± 0.09%'        | '49801 ± 755'          | 46516   |

The benchmark shows no material regression in the existing implementation and React Native remains faster than ungap/structured-clone across all scenarios.

Changelog:
[General][Added] - Add ArrayBuffer, DataView, typed array, boxed BigInt, and Error subclass support to structuredClone

Differential Revision: D122156629
rubennorte added a commit to rubennorte/react-native that referenced this pull request Sep 29, 2026
Summary:

Compare React Native structuredClone with ungap/structured-clone (**used by Expo**) and port the applicable upstream coverage. Add support for ArrayBuffer, DataView, typed arrays, boxed BigInt values, Error subclasses, deeply cloned causes, and safe __proto__ data properties. Serialization-only and JSON/lossy tests remain out of scope because React Native exposes a single-step cloning API.

Add ungap/structured-clone as a devDependency and benchmark each existing Fantom scenario against it.

Before — React Native implementation before this change:

### structuredClone (mode 🚀) ###

| (index) | Task name                | Latency avg (ns)  | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ------------------------ | ----------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'clone a string'         | '338.62 ± 0.05%'  | '330.00 ± 9.00'  | '3014547 ± 0.05%'      | '3030303 ± 84962'      | 2953184 |
| 1       | 'clone a basic array'    | '1587.6 ± 10.36%' | '1353.0 ± 19.00' | '734465 ± 0.42%'       | '739098 ± 10235'       | 638616  |
| 2       | 'clone a basic object'   | '1344.2 ± 8.81%'  | '1172.0 ± 20.00' | '828917 ± 0.33%'       | '853242 ± 14813'       | 743963  |
| 3       | 'clone a complex object' | '3370.6 ± 0.60%'  | '3255.0 ± 40.00' | '304183 ± 0.02%'       | '307220 ± 3822'        | 296680  |

After — React Native compared with ungap/structured-clone:

### structuredClone (mode 🚀) ###

| (index) | Task name                              | Latency avg (ns)  | Latency med (ns)  | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------------------- | ----------------- | ----------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'React Native: clone a string'         | '348.44 ± 0.08%'  | '331.00 ± 1.00'   | '2927181 ± 0.04%'      | '3021148 ± 9155'       | 2869970 |
| 1       | 'ungap: clone a string'               | '2037.4 ± 11.17%' | '1592.0 ± 50.00'  | '617833 ± 0.09%'       | '628141 ± 19947'       | 490832  |
| 2       | 'React Native: clone a basic array'    | '1460.2 ± 8.39%'  | '1282.0 ± 20.00'  | '775137 ± 0.42%'       | '780031 ± 12362'       | 684824  |
| 3       | 'ungap: clone a basic array'          | '5112.8 ± 0.81%'  | '4718.0 ± 111.00' | '205586 ± 0.08%'       | '211954 ± 5107'        | 195589  |
| 4       | 'React Native: clone a basic object'   | '1373.8 ± 8.58%'  | '1152.0 ± 20.00'  | '842837 ± 0.46%'       | '868056 ± 15337'       | 727910  |
| 5       | 'ungap: clone a basic object'         | '8853.2 ± 0.76%'  | '8253.0 ± 141.00' | '117562 ± 0.05%'       | '121168 ± 2106'        | 112954  |
| 6       | 'React Native: clone a complex object' | '3539.4 ± 0.55%'  | '3456.0 ± 50.00'  | '288368 ± 0.02%'       | '289352 ± 4248'        | 282537  |
| 7       | 'ungap: clone a complex object'       | '21498 ± 0.72%'   | '20080 ± 301.00'  | '48208 ± 0.09%'        | '49801 ± 755'          | 46516   |

The benchmark shows no material regression in the existing implementation and React Native remains faster than ungap/structured-clone across all scenarios.

Changelog:
[General][Added] - Add ArrayBuffer, DataView, typed array, boxed BigInt, and Error subclass support to structuredClone

Differential Revision: D122156629
Summary:
Compare React Native structuredClone behavior with ungap/structured-clone and port the applicable upstream coverage. Add support for ArrayBuffer, DataView, typed arrays, boxed BigInt values, Error subclasses, deeply cloned causes, and safe __proto__ data properties. Serialization-only and JSON/lossy tests remain out of scope because React Native exposes a single-step cloning API.

The comparison dependency and benchmark cases were used only to collect the results below and are not shipped with React Native.

Before — React Native implementation before this change:

### structuredClone (mode 🚀) ###

| (index) | Task name                | Latency avg (ns)  | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ------------------------ | ----------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'clone a string'         | '338.62 ± 0.05%'  | '330.00 ± 9.00'  | '3014547 ± 0.05%'      | '3030303 ± 84962'      | 2953184 |
| 1       | 'clone a basic array'    | '1587.6 ± 10.36%' | '1353.0 ± 19.00' | '734465 ± 0.42%'       | '739098 ± 10235'       | 638616  |
| 2       | 'clone a basic object'   | '1344.2 ± 8.81%'  | '1172.0 ± 20.00' | '828917 ± 0.33%'       | '853242 ± 14813'       | 743963  |
| 3       | 'clone a complex object' | '3370.6 ± 0.60%'  | '3255.0 ± 40.00' | '304183 ± 0.02%'       | '307220 ± 3822'        | 296680  |

After — React Native compared with ungap/structured-clone:

### structuredClone (mode 🚀) ###

| (index) | Task name                              | Latency avg (ns)  | Latency med (ns)  | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------------------- | ----------------- | ----------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'React Native: clone a string'         | '348.44 ± 0.08%'  | '331.00 ± 1.00'   | '2927181 ± 0.04%'      | '3021148 ± 9155'       | 2869970 |
| 1       | 'ungap: clone a string'               | '2037.4 ± 11.17%' | '1592.0 ± 50.00'  | '617833 ± 0.09%'       | '628141 ± 19947'       | 490832  |
| 2       | 'React Native: clone a basic array'    | '1460.2 ± 8.39%'  | '1282.0 ± 20.00'  | '775137 ± 0.42%'       | '780031 ± 12362'       | 684824  |
| 3       | 'ungap: clone a basic array'          | '5112.8 ± 0.81%'  | '4718.0 ± 111.00' | '205586 ± 0.08%'       | '211954 ± 5107'        | 195589  |
| 4       | 'React Native: clone a basic object'   | '1373.8 ± 8.58%'  | '1152.0 ± 20.00'  | '842837 ± 0.46%'       | '868056 ± 15337'       | 727910  |
| 5       | 'ungap: clone a basic object'         | '8853.2 ± 0.76%'  | '8253.0 ± 141.00' | '117562 ± 0.05%'       | '121168 ± 2106'        | 112954  |
| 6       | 'React Native: clone a complex object' | '3539.4 ± 0.55%'  | '3456.0 ± 50.00'  | '288368 ± 0.02%'       | '289352 ± 4248'        | 282537  |
| 7       | 'ungap: clone a complex object'       | '21498 ± 0.72%'   | '20080 ± 301.00'  | '48208 ± 0.09%'        | '49801 ± 755'          | 46516   |

The benchmark shows no material regression in the existing implementation and React Native remains faster than ungap/structured-clone across all scenarios.

Changelog:
[General][Added] - Add ArrayBuffer, DataView, typed array, boxed BigInt, and Error subclass support to structuredClone

Reviewed By: javache

Differential Revision: D122156629
@meta-codesync meta-codesync Bot changed the title Expand structuredClone compatibility and benchmarks (#58735) Expand structuredClone compatibility Sep 29, 2026
rubennorte added a commit to rubennorte/react-native that referenced this pull request Sep 29, 2026
Summary:

Compare React Native structuredClone behavior with ungap/structured-clone and port the applicable upstream coverage. Add support for ArrayBuffer, DataView, typed arrays, boxed BigInt values, Error subclasses, deeply cloned causes, and safe __proto__ data properties. Serialization-only and JSON/lossy tests remain out of scope because React Native exposes a single-step cloning API.

The comparison dependency and benchmark cases were used only to collect the results below and are not shipped with React Native.

Before — React Native implementation before this change:

### structuredClone (mode 🚀) ###

| (index) | Task name                | Latency avg (ns)  | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ------------------------ | ----------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'clone a string'         | '338.62 ± 0.05%'  | '330.00 ± 9.00'  | '3014547 ± 0.05%'      | '3030303 ± 84962'      | 2953184 |
| 1       | 'clone a basic array'    | '1587.6 ± 10.36%' | '1353.0 ± 19.00' | '734465 ± 0.42%'       | '739098 ± 10235'       | 638616  |
| 2       | 'clone a basic object'   | '1344.2 ± 8.81%'  | '1172.0 ± 20.00' | '828917 ± 0.33%'       | '853242 ± 14813'       | 743963  |
| 3       | 'clone a complex object' | '3370.6 ± 0.60%'  | '3255.0 ± 40.00' | '304183 ± 0.02%'       | '307220 ± 3822'        | 296680  |

After — React Native compared with ungap/structured-clone:

### structuredClone (mode 🚀) ###

| (index) | Task name                              | Latency avg (ns)  | Latency med (ns)  | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------------------- | ----------------- | ----------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'React Native: clone a string'         | '348.44 ± 0.08%'  | '331.00 ± 1.00'   | '2927181 ± 0.04%'      | '3021148 ± 9155'       | 2869970 |
| 1       | 'ungap: clone a string'               | '2037.4 ± 11.17%' | '1592.0 ± 50.00'  | '617833 ± 0.09%'       | '628141 ± 19947'       | 490832  |
| 2       | 'React Native: clone a basic array'    | '1460.2 ± 8.39%'  | '1282.0 ± 20.00'  | '775137 ± 0.42%'       | '780031 ± 12362'       | 684824  |
| 3       | 'ungap: clone a basic array'          | '5112.8 ± 0.81%'  | '4718.0 ± 111.00' | '205586 ± 0.08%'       | '211954 ± 5107'        | 195589  |
| 4       | 'React Native: clone a basic object'   | '1373.8 ± 8.58%'  | '1152.0 ± 20.00'  | '842837 ± 0.46%'       | '868056 ± 15337'       | 727910  |
| 5       | 'ungap: clone a basic object'         | '8853.2 ± 0.76%'  | '8253.0 ± 141.00' | '117562 ± 0.05%'       | '121168 ± 2106'        | 112954  |
| 6       | 'React Native: clone a complex object' | '3539.4 ± 0.55%'  | '3456.0 ± 50.00'  | '288368 ± 0.02%'       | '289352 ± 4248'        | 282537  |
| 7       | 'ungap: clone a complex object'       | '21498 ± 0.72%'   | '20080 ± 301.00'  | '48208 ± 0.09%'        | '49801 ± 755'          | 46516   |

The benchmark shows no material regression in the existing implementation and React Native remains faster than ungap/structured-clone across all scenarios.

Changelog:
[General][Added] - Add ArrayBuffer, DataView, typed array, boxed BigInt, and Error subclass support to structuredClone

Reviewed By: javache

Differential Revision: D122156629

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant