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

Large (52%) Performance Gains #37

Open
wants to merge 2 commits into
base: gemstone
Choose a base branch
from

Conversation

TimStanglow
Copy link

See the relevant commit

Drasticly imporves Performance by avoiding repeated calls to numpy.flip() by saving a flipped version of the repeatadly flipped array.
This turn getVisibleHistory() into a single line Method, so it was placed inline to avoid the function call for further performance gains.
Performance gains: reduced the time needed to run a 10 (9 examples + mine) Strategy tournament repeatatly (100 times) from 12.84s to 6.161. (52%)
EFHIII added a commit to Prisoners-Dilemma-Enjoyers/PrisonersDilemmaTournament that referenced this pull request May 23, 2021
@zebarnabe
Copy link

I get some performance gains, however they are far from the 52% gain stated, running in a environment with 48 strategies (1128 rounds per tournament), for me the time taken to run 10 tournaments is:

  • 1m10,859s with the original code
  • 1m4,297s with the optimization

One thing that has a lot of impact in the overall time is the performance of the strategies themselves, in my case I have a few strategies that take quite some time when compared with the examples.

In any case, in the context of the tournament code, there is a measurable improvement in the execution time with this change.

zebarnabe pushed a commit to zebarnabe/PrisonersDilemmaTournament that referenced this pull request May 27, 2021
Cache by hash as well as modification time
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.

2 participants