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

相補塩基を出力する計算の高速化 #36

Open
rrbox opened this issue Sep 27, 2022 · 2 comments
Open

相補塩基を出力する計算の高速化 #36

rrbox opened this issue Sep 27, 2022 · 2 comments

Comments

@rrbox
Copy link
Owner

rrbox commented Sep 27, 2022

Dictionary を使ったグラフを使用した方が早いかもしれない.

こちらの開発環境では, 以下の結果が出ている.

  • ビット演算による計算 : 10万塩基での計算で 0.165 ~ 0.210 sec
  • グラフ(元の塩基を key, 相補塩基を value にしたハッシュマップ)による計算 : 10万塩基での計算でおよそ 0.104 sec

おそらく, Dictionary を使用するとメモリ消費を犠牲に計算が高速になっていると考えられる. また, Dictionary には全ての複合塩基を変換するのは難しいというデメリットがあることもわかった(ビット演算はいかなる複合塩基も同じようにビット回転させるだけなので一つの関数だけですむ).

@rrbox
Copy link
Owner Author

rrbox commented Sep 27, 2022

Dictionary で全ての複合塩基を計算するのは不可能ではない. 全て定義すればいい. ただ, コードを書く作業が大変なので, 実験は後日行う.

@rrbox
Copy link
Owner Author

rrbox commented Sep 27, 2022

実際に全ての複合塩基を辞書に入れてテストしたが, 速度に違いはなく, やはりビット演算よりも高速であった. しかし, 辞書の場合は全ての複合塩基について書き間違いがないかをテストする必要があるので, 全ての複合塩基に関するテストを記述する必要がある.

@rrbox rrbox changed the title 相補塩基の高速化 相補塩基を出力する計算の高速化 Oct 25, 2022
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