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

Memory leak in ts.variants() #2427

Closed
jeromekelleher opened this issue Jul 21, 2022 · 0 comments
Closed

Memory leak in ts.variants() #2427

jeromekelleher opened this issue Jul 21, 2022 · 0 comments
Labels
bug Something isn't working Python API Issue is about the Python API
Milestone

Comments

@jeromekelleher
Copy link
Member

Benchmark:

import msprime
import time


before = time.perf_counter()
ts = msprime.sim_ancestry(
    10000,
    sequence_length=1000000,
    population_size=10_000,
    recombination_rate=1e-8,
    random_seed=1234,
)
ts = msprime.sim_mutations(ts, rate=1e-7, random_seed=1)
duration = time.perf_counter() - before
print(f"Simulation of {ts.num_trees} trees done after {duration:.2f} seconds")

for _ in range(10):
    for var in ts.variants():
        pass

Result:
vars-before

This is because the version of variants introduced in #2397 always looks at ts.tables.sites.position. This was released in 0.5.1.

@jeromekelleher jeromekelleher added bug Something isn't working Python API Issue is about the Python API labels Jul 21, 2022
@jeromekelleher jeromekelleher added this to the Python 0.5.2 milestone Jul 21, 2022
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 21, 2022
Also remove most references to self.tables from the TreeSequence class,
resolving a number of performance/memory issues.

Closes tskit-dev#1916
Closes tskit-dev#1917
Closes tskit-dev#2423
Closes tskit-dev#2427
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 21, 2022
Also remove most references to self.tables from the TreeSequence class,
resolving a number of performance/memory issues.

Closes tskit-dev#1916
Closes tskit-dev#1917
Closes tskit-dev#2423
Closes tskit-dev#2427
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 22, 2022
Also remove most references to self.tables from the TreeSequence class,
resolving a number of performance/memory issues.

Closes tskit-dev#1916
Closes tskit-dev#1917
Closes tskit-dev#2423
Closes tskit-dev#2427
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 26, 2022
Also remove most references to self.tables from the TreeSequence class,
resolving a number of performance/memory issues.

Closes tskit-dev#1916
Closes tskit-dev#1917
Closes tskit-dev#2423
Closes tskit-dev#2427
@mergify mergify bot closed this as completed in ada9596 Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python API Issue is about the Python API
Projects
None yet
Development

No branches or pull requests

1 participant