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

Optimise &sha256. #14

Merged
merged 1 commit into from Nov 18, 2015
Merged

Optimise &sha256. #14

merged 1 commit into from Nov 18, 2015

Conversation

arnsholt
Copy link
Contributor

When working on the ipython kernel, I noticed that the HMAC step was taking a while, so I decided to try to optmise the hash function a bit. This is the result.

I made three changes:

  • Moved the initialisation of $K outside of the function, since it's a
    constant for the algorithm.
  • Some fancy construction (metaops, gather/take) were replaced with more
    verbose constructions with less overhead.
  • Array accesses with postcircumfix:<[ ]> were replaced with the lower-level
    .AT-POS method in the inner loop of the algorithm.

I made three changes:
- Moved the initialisation of $K outside of the function, since it's a
  constant for the algorithm.
- Some fancy construction (metaops, gather/take) were replaced with more
  verbose constructions with less overhead.
- Array accesses with postcircumfix:<[ ]> were replaced with the lower-level
  .AT-POS method in the inner loop of the algorithm.

Many thanks to timotimo++ for his help with this.
grondilu added a commit that referenced this pull request Nov 18, 2015
Optimise &sha256.  Perfomance matters quite a bit for this module so I'm ok with this, even though I will welcome syntactic simplifications that keep or improve performance.
@grondilu grondilu merged commit 2dce53f into grondilu:master Nov 18, 2015
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.

None yet

2 participants