Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Conversation

@k163377
Copy link
Collaborator

@k163377 k163377 commented May 16, 2020

共通化

  • コンパニオンオブジェクトからアノテーションを含む関数を取得する関数を追加
  • 関数列からアノテーションを含む関数を取得する関数を追加
  • KParameterからKClassを取得する関数を追加

最適化

コンパニオンオブジェクトから関数を取得する際、当初以下のように処理を行っていた。

  1. コンパニオンオブジェクトのインスタンスを取得する
  2. インスタンスが取得できればクラスを取得する
  3. クラスから関数を取得する

この順序では、関数の有無にかかわらず1と2が走るという問題が有った。
また、コンパニオンオブジェクトのインスタンス取得よりもクラス取得の方が高速であった。

このため、処理を以下の順序に改め、インスタンス取得の回数を減らした。

  1. コンパニオンオブジェクトのクラスを取得
  2. クラスを取得できれば関数を取得する
  3. 関数を取得できればインスタンスを取得する

@k163377 k163377 self-assigned this May 16, 2020
@k163377 k163377 merged commit 7264eab into ProjectMapK:master May 16, 2020
@k163377 k163377 deleted the functions branch May 16, 2020 15:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant