Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deepcopy #18

Merged
merged 2 commits into from
Apr 19, 2024
Merged

Replace deepcopy #18

merged 2 commits into from
Apr 19, 2024

Conversation

nossleinad
Copy link
Collaborator

Follow up to PR #16

This PR accomplishes two things:

  1. Replaces deepcopy with copy_partition and copy_message throughout the whole package
  2. Implements copy_partition for SWMPartition

Example where we have replaced deepcopy:

tree = sim_tree(n = 100_000)
empty_message = [NucleotidePartition(30)]
@time MolecularEvolution.random_leaf_init!(tree, empty_message)

# main
 0.521992 seconds (6.95 M allocations: 379.846 MiB, 24.52% gc time, 9.05% compilation time)

# PR
 0.405800 seconds (6.73 M allocations: 346.599 MiB, 28.74% gc time, 11.90% compilation time)

Example with SWMPartition:

tree = sim_tree(n = 10_000)
@time internal_message_init!(tree, SWMPartition{CodonPartition}(CodonPartition(30), 2))

# main
 0.536884 seconds (800.27 k allocations: 1.737 GiB, 29.93% gc time, 1.52% compilation time)

# PR
 0.355919 seconds (679.98 k allocations: 1.718 GiB, 46.63% gc time)

@murrellb murrellb merged commit af0b4ed into MurrellGroup:main Apr 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants