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

Profile percentage of game state copying #47

Closed
peter1591 opened this issue Jun 24, 2017 · 1 comment
Closed

Profile percentage of game state copying #47

peter1591 opened this issue Jun 24, 2017 · 1 comment

Comments

@peter1591
Copy link
Owner

In current implementation,
before applying each action (i.e., play-card, attack, hero-power, or end-turn)
the game state is saved on stack
This game state is restored if the action is actually an invalid action and make the application failed.

We can make the game state to be copy-on-write,
and support the fast response for those methods which are probably invoked when applying an invalid action

Since there are many discussions on the efficiency of copy-on-write data structures,
it's better to delay after we've done some profiling.

@peter1591
Copy link
Owner Author

The underlying reason is that the chance leading to an invalid state should be quite low. Move to another issue to optimize this at the final stage.

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

No branches or pull requests

1 participant