Use Docker to test the performance of different versions of Python and compare it to C++ on the same task.
WARNING
The Optimized C++ version (-O3) (0.336514) acticutally is way more faster than the C++ -O (11.1504 seconds ) in the following example. Thus C++ is still the best choice for this task and it is ~110x times faster than Python 3.11.
The following figure shows the performance of different versions of Python and C++ (Non-Optimized) on the same task. The optimized C++ version is not included in the following figure.
- Python environment
- Docker
DNA K-mers In bioinformatics, k-mers are substrings of length k
contained within a biological sequence. Primarily used within the context of computational genomics and sequence analysis.
Genome assembly algorithm DNA K-mers. The idea behind this algorithm is simple, DNA is a long string of sequences called nucleotides.
In DNA, there are 4 nucleotides represented by the letters A, C, G and T. Humans (or more accurately Homo sapiens) have 3 billion nucleotide pairs. For example, a small portion of human DNA might be:
ACTAGGGATCATGAAGATAATGTTGGTGTTTGTATGGTTTTCAGACAATT
In this example, if one wanted to select any 4 consecutive nucleotides (i.e. letters) from this string, it would be a k-mer of length 4 ( We call it 4-mer).
Here are some examples of 4-mers derived from the examples.
ACTA, CTAG, TAGG, AGGG, GGGA
For this repo, let's generate all possible 13-mers
. Mathematically, this is a permutation problem. Therefore, we have
I use a simple algorithm to generate results in C++ and Python.
Let's see how different Python versions compare to C++.
Test the performance of different versions of Python and compare it to C++ on the same task.
python run_main_test.py
IF you want to run the C++ version of Task, you need to install the g++ compiler.