Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save a get operation in ScriptEntry#getNext() - this seems to be the …
…bottleneck for Denizen, so perhaps could look into using a Queue or entry head index in the future
- Loading branch information
1e05cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I've known there is some kind of bottleneck in that process. Can't wait to see the difference in /testload
1e05cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, how would your two suggestions work?
1e05cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently script_entries is read left-to-right and entries are removed from the beginning of the list. This is more costly as the rest of the entries are shifted to the left. If you could rework the code to remove from the end of the list or avoid the .remove(0) call you can save that processing. (note that it was the bottleneck in a microbenchmark from mcmonkey)