-
Notifications
You must be signed in to change notification settings - Fork 175
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
Refactor KVI 2 #538
Closed
Closed
Refactor KVI 2 #538
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@dinomite
|
a2ac09a
to
cf64d24
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a continuation of #512.
It also implements up to 2 of the comments below.
#439 (comment)
Changes from existing
Improve the efficiency of argument management
The following inefficiencies existed in the argument management process in
KVI
.Map
generation is being done when callingValueCreator.callBy
.KFunction.callBy
even in situations whereKFunction.call
can be used.In this change, these processes have been improved.
About
ArgumentBucket
Here is an overview of
ArgumentBucket
, the most significant change in this PR.ArgumentBucket
is a class that holds arguments while sorting them like a bucket sort.This makes it easy to call
KFunction.call
orsuper.createFromObjectWith(cxt, argumentBucket.actualValues)
.Compared to #439, the difference is that the
Map
interface is inherited, but this is a change to pass it directly as an argument toKFunction.callBy
.Initialization for argument reading is done only minimally in the
BucketGenerator
.Points that have not been changed this PR
No changes have been made to the refactoring and streamlining of the argument reading process in
KVI
.Since the same judgment is made for the same
KParameter
each time it is called, caching the process is expected to speed up the process.However, considering that the scope of the change would be too large if it were included in this PR, I decided not to modify it.
Benchmark results
The results of the benchmark comparison are as follows.
Compared to
2.13.2-SNAPSHOT
, the score itself has not changed much, but the error score has decreased, so it is probably improved.2.13.1
99389f3(2.13.2-SNAPSHOT)
this change
I don't think there is any major concern about this result, at least not since the score has not decreased.
In fact, this change does not have enough effect to reduce the reflection process.
However, I am concerned about the fact that the change in the
c.w.factory.Benchmarks.useKotlinMapper
score seems to be small, despite the avoidance ofSpread Operator
and the use ofKFunction.call
.In my experience, I expected these changes to have a larger effect.
I haven't had time to check why this is the case, but I may add it to the explanation if I find out anything.