Skip to content

Speed bottleneck on deepcopy #152

Closed
@MicaelJarniac

Description

@MicaelJarniac

We're having issues with extremely slow queries while using the object mapper. The raw query itself isn't slow, but instancing the objects in Python seems to be.

While profiling, we noticed that there seems to be a bottleneck on the following line, using deepcopy:

copied_value = deepcopy(value)

We're not entirely sure what that deepcopy is for, so we tried removing it locally, and it seemed to result in a huge speed boost.

I believe simply removing it might break something, so I won't suggest doing that straight away, but I believe there might be a better approach to this that could avoid deepcopy when not necessary.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions