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

Intrinsics mod #16

Open
wants to merge 7 commits into
base: noobhack-0.3
Choose a base branch
from
Open

Intrinsics mod #16

wants to merge 7 commits into from

Conversation

CJYate
Copy link
Contributor

@CJYate CJYate commented Oct 7, 2011

Hi,

I found the searches done in Brain.py to look for intrinsic gained/lost messages were slowing down the game considerably in some circumstances (especially when entering long-ish lines in the console; e.g. specifying wishes, naming items or engraving messages).

The search code was basically looping through Dictionaries of Dictionaries in Python, then applying a regex search to the results. To speed things up I've reimplemented the searching code in C++ with some pre-caching of the search terms and results, which seems to significantly improve performance.

This could be extended to the other dispatch functions (e.g. _dispatch_status_events() -- if the Brain gets cleverer more functionality might need to be compiled into modules.

Regular Expressions searching is handled using Boost::Regex -- I hope that dependency isn't a problem. Boost is easily installable through aptitude or similar.

cheers,
Chris

…ntrinsics and if it works, roll into other dispatch methods.

This is intermediate checkin and breaks the functionality temporarily.
…essages, in case the message goes across multiple lines.
intrinsics.py : Since we're now looking at regex search we don't want full stops in the search strings - removed. Also removed are exclamation marks.

setup.py : modified the Extensions build info to link against libboost_regex
@samfoo
Copy link
Owner

samfoo commented Oct 10, 2011

For the moment I'm going to let this sit in limbo. I have a big change coming through (previewed on the proper-mapping) branch that I'd like to finish for 0.3, then make this (and other perf improvements) part of the upcoming (heretofore non-existant) 0.4 branch.

Hopefully I'll be able to finish proper-mapping this week and then merge 0.3 back to master at which point this commit will be the start of the new dev branch.

Sam

@CJYate
Copy link
Contributor Author

CJYate commented Oct 10, 2011

Hi Sam, That's cool, thanks for letting me know.

cheers,
Chris

On 10 October 2011 11:50, Sam Gibson
[email protected]
wrote:

For the moment I'm going to let this sit in limbo. I have a big change coming through (previewed on the proper-mapping) branch that I'd like to finish for 0.3, then make this (and other perf improvements) part of the upcoming (heretofore non-existant) 0.4 branch.

Hopefully I'll be able to finish proper-mapping this week and then merge 0.3 back to master at which point this commit will be the start of the new dev branch.

Sam

Reply to this email directly or view it on GitHub:
#16 (comment)

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