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

Optimization #6

Open
Fasjeit opened this issue Sep 24, 2018 · 5 comments
Open

Optimization #6

Fasjeit opened this issue Sep 24, 2018 · 5 comments

Comments

@Fasjeit
Copy link
Owner

Fasjeit commented Sep 24, 2018

Here is some ideas for optimization:

@Fasjeit
Copy link
Owner Author

Fasjeit commented Nov 26, 2018

Rewrite all byte logic with spans. (or pipes?)
Rewrite keccak-f with intrinsics.

@mimoo
Copy link

mimoo commented Nov 26, 2018

Can you leverage XKCP? They have implementations of keccak-f with intrinsics.

@Fasjeit
Copy link
Owner Author

Fasjeit commented Nov 26, 2018

I'll definitely take a look.

The possible idea is not to use wrapper around native (c or asm) implementation, but to use intrinsics inside managed (c# code). Using wrapper can cause a little bit more time consumption for every native call, but using intrinsics tells the compiler just used the specified assembly code.

Example link for me - sha256

Spans\pipes have more priority, as using these allow to use stack instead of heap for all transformations and get rid of all GC time waste.

@Fasjeit
Copy link
Owner Author

Fasjeit commented Nov 27, 2018

Links to read - 1, 2

Pipes and TCP

spans and readonly

General plan is:

  • Create Pipe methods using sync Strobe - how to return message?
  • Create async Strobe api consuming PipeReader. Inside is just readAsync Pipe method.
  • Create WritePipe method in Disco using Strobe Async Api
  • Deal with buffer size in Pipe methods

@Fasjeit
Copy link
Owner Author

Fasjeit commented Jan 23, 2019

Looks like C# 8.0 have the exactly feature we need - yield async.
Unfortunately it is available only in preview version of VS 2019, and it;s quite buggy, at least until preview 2. Proposed fix works, but I still get other errors during FlushAsync in pipeWriter. Not sure is this the same problem of not.

link

Now I have to just wait until preview 2 and try again.

Current changes are in pipleline branch.

Also we have to switch to .net core 3.0. Looks like both travis and appveyor does not support it right now.

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

2 participants