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

State encoding/decoding performance #127

Open
dglmoore opened this issue Apr 11, 2019 · 2 comments
Open

State encoding/decoding performance #127

dglmoore opened this issue Apr 11, 2019 · 2 comments

Comments

@dglmoore
Copy link
Contributor

Many of the analysis functions require converting states from lists to integers (encoding) and back (decoding). For example, in order to compute the attractors for a network integer states must be decoded, updated and then encoded again. Python can do this; but, being python, it's slow as sin. To deal with this we have two options:

C/C++ or Cython Implementation

We could implement these core functions in something C-like. The advantage of this is that it'll be very snappy. The disadvantage is, well, C/C++. That means distributing either a binary dependency or requiring the user to have a C/C++ compiler installed.

Network.update(int)

Alternatively, we can implement update methods that operate on integer encodings directly. That is, for example, if LogicNetwork.update receives a list the function behaves as it currently does; however, if it receives an integer it updates the bits of the integer according to the update rule. This saves encoding/decoding at the expense of a more complicated implementation.

@hbsmith
Copy link
Contributor

hbsmith commented Aug 19, 2019

Related to #154

@dglmoore
Copy link
Contributor Author

dglmoore commented Aug 25, 2019

@hbsmith I've been banging my head against this for a while now. I don't think there's a simple way to make this happen. Whatever we end up doing is going to take more time than we have before the next release. I propose we push this, #154 and #133 to the next release, possibly v1.1 or v1.2?

@dglmoore dglmoore removed this from the Version 1.0.0 milestone Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants