---
schema_version: "1"
id: 0f4a9272113250835d5f06e3b21ac800fa9135944c55383b1593ede51c6906f8
title: Optimized Performance with Targeted Cloning (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_optimize_performance_with_targeted_cloning.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_optimize_performance_with_targeted_cloning.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 350083a2599c173368fe3c03f63e0518803b52e6408975c4e1894154552ec921
description: To maximize performance, clone only the specific object nodes that you want to modify. This approach creates an object where only the specified node is modifiable, and the other nodes of the object remain in their original read-only state.
products:
  - Communications
release: "264"
---
# Optimized Performance with Targeted Cloning (Managed Package)

To maximize performance, clone only the specific object nodes that you want to modify. This approach creates an object where only the specified node is modifiable, and the other nodes of the object remain in their original read-only state.

| REQUIRED EDITIONS |
| --- |
| Available in: Lightning Experience |
| Available in: **Enterprise**, **Developer**, and **Unlimited** Editions |

## Cloning Specific Nodes

![Managed Package Icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-communications-264-0-0-production-enus/444efb86-ea1e-477e-afbc-56eaac192eaf/communications/images/media_package_icon.png) _This feature is part of the Communications Cloud managed package._

This process makes sure that you make modifiable copies of only the specific nodes that you want to modify.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-communications-264-0-0-production-enus/444efb86-ea1e-477e-afbc-56eaac192eaf/images/icon_example.png)

Example

This example uses the `map()` iterator to create modifiable copies of only the necessary attribute nodes.

```
let newModifiableNode = childLineItem.originalNonModifiableAttributeNode?.map(originalNonModifiableAttribute => {
    let attr = enhancedDeepClone(originalNonModifiableAttribute); // This copy is modifiable
    attr.binded = childLineItem.action === 'Add' && this.bindedAttributes[childLineItem.PricebookEntry.Product2.ProductCode] !== undefined && this.bindedAttributes[childLineItem.PricebookEntry.Product2.ProductCode].includes(attr.code);
    return attr;
    });
```

Reinsert the new modifiable node into the original object after cloning.

```
childLineItem = {...childLineItem, originalNonModifiableAttributeNode: newModifiableNode};
```