Python: fix: optimize function_copy to avoid unnecessary deepcopy by nimanikoo · Pull Request #13599 · microsoft/semantic-kernel

@nimanikoo

- Implement lazy deepcopy in function_copy() method
- Only copy metadata when plugin_name actually changes
- Reuse metadata reference when no modification needed
- performance improvement in function_copy operations
- Add unit tests to verify lazy copy behavior

@moonbox3 moonbox3 added the python

Pull requests for the Python Semantic Kernel

label

Feb 27, 2026

@github-actions github-actions bot changed the title fix: optimize function_copy to avoid unnecessary deepcopy Python: fix: optimize function_copy to avoid unnecessary deepcopy

Feb 27, 2026

@nimanikoo

github-actions[bot]

@nimanikoo @github-actions

For enable deep copy

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Copilot AI review requested due to automatic review settings

March 24, 2026 09:30

@nimanikoo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

@nimanikoo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

moonbox3