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

Small performance improvement #9

Open
ante-turudic opened this issue Nov 27, 2019 · 0 comments
Open

Small performance improvement #9

ante-turudic opened this issue Nov 27, 2019 · 0 comments

Comments

@ante-turudic
Copy link

I am checking RSCU() method and it seems to me that small performance improvement is possible in codon counting. It should be faster to once call upper() method for a sequence than for each of it's codons separately.
Lines ~80, adding line like sequences = [s.upper() for s in sequences] can improve perf.

Simple check shows ~30% improvements:

python3 -m timeit 'x = ("a"*300000); [x[i: i+3].upper() for i in range(0, len(x), 3)]'
10 loops, best of 3: 21.3 msec per loop
python3 -m timeit 'x = ("a"*300000).upper(); [x[i: i+3] for i in range(0, len(x), 3)]'
100 loops, best of 3: 14.5 msec per loop

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

No branches or pull requests

1 participant