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

gtree パッケージの更新 #24

Merged
merged 1 commit into from
Sep 30, 2023
Merged

Conversation

ddddddO
Copy link
Contributor

@ddddddO ddddddO commented Sep 29, 2023

@orangekame3
お忙しいところ度々失礼いたします!🙇

gtree パッケージの OutputProgrammably func の内部実装を少し変更して、処理回数を減らしました!
なので、ツール利用者からすると若干ですが体感の処理速度ははやくなるかと思います。

変更前

  1. ツリーを構成する全node分、枝を形成する
  2. ツリーの各node毎に枝を出力する

変更後

  1. ツリーを構成する各node毎に枝の形成と出力を同タイミングで行う

要は変更前後で余分なループを減らしました!

あと蛇足ですが、もう少し改善できないか考え、gtree パッケージの .Addメソッド呼び出し直後に枝を返せないか検討してみました。
結果、一度ツリーを構成した後でなければ、枝を決定できなさそうと気づきました🙇
ref: ddddddO/gtree#239 (comment)

とは言っても、こちらのツールはprefix指定できるので、利用者からするとさほど問題にはならなそうと思ってます!

@orangekame3
Copy link
Owner

@ddddddO
ありがとうございます!LGTMです。
パフォーマンスの向上素晴らしいです!!

@orangekame3 orangekame3 merged commit f12eaf7 into orangekame3:main Sep 30, 2023
1 check passed
@orangekame3 orangekame3 mentioned this pull request Sep 30, 2023
@ddddddO ddddddO deleted the update_gtree branch September 30, 2023 01:56
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.

None yet

2 participants