Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Examine performance of run time versus import time #41

Closed
exodrifter opened this issue Dec 14, 2014 · 3 comments
Closed

Examine performance of run time versus import time #41

exodrifter opened this issue Dec 14, 2014 · 3 comments
Assignees

Comments

@exodrifter
Copy link
Owner

In issue #16, the behavior of Raconteur was changed to parse the script at import time instead of at run time. This was done to avoid a performance impact at run time.

It is not evident if there was any change in performance, but it is clear that the custom asset files generated by Raconteur are much bigger in file size now (about 8-9x). For this reason, it should be considered if it would be worthwhile to change back to the old behavior .

The benefits of both behaviors should be analyzed and the one with the lowest impact on run time should be used.

@exodrifter exodrifter self-assigned this Dec 14, 2014
@exodrifter exodrifter added this to the Version 2 milestone Dec 14, 2014
@exodrifter
Copy link
Owner Author

I have determined that in commit d380061, the build before the behavior was changed, the perceived delay at run time was not due to parsing but to the number of init statements (as they were bottlenecked by how often update() got called) that were executed before the first block.

A slightly more noticeable wait can be experienced at the beginning on a level when the script is parsed in the Awake() method of the RenPyDisplay class, but only when the script gets noticeably long (~10,000 lines). In any case, a small wait at the beginning of the level is preferable to a small wait right before the player gets to talk to someone.

In the most recent commit (2d3a791), a slightly shorter, but not significant, delay can be felt when trying to play the level.

The impact at run time for parsing a script seems to be negligible. Switching to parsing the script at runtime will reduce the file size and also make the code easier to maintain as less objects would need to deal with the ScriptableObject API.

@exodrifter
Copy link
Owner Author

Commit 801c4b8 accidentally referred to this issue when it meant to close issue #42.

@exodrifter exodrifter reopened this Dec 14, 2014
@exodrifter
Copy link
Owner Author

Due to the negligible performance impact and increased API complexity, it would be better to parse at run time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant