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

Performance drop after creating missing NIDs #433

Closed
marcfedorow opened this issue Dec 20, 2022 · 4 comments · May be fixed by #459
Closed

Performance drop after creating missing NIDs #433

marcfedorow opened this issue Dec 20, 2022 · 4 comments · May be fixed by #459

Comments

@marcfedorow
Copy link
Contributor

97b3db1
This exact patch gives 2% performance decrease on my RISC-V processor.
test:

openssl speed -evp kuznyechik-ecb -seconds 5

I do not understand how a function that is called once may affect performance that much.

@beldmit
Copy link
Contributor

beldmit commented Dec 20, 2022

If you are looking for a performance, I'd suggest really profile the code. Cipher itself has a lot of place to improve

BTW, NID allocation may require some locking.

@marcfedorow
Copy link
Contributor Author

I re-wrote it with inline assembly so that's 2% of optimized score.
Still, that seems alot.

@marcfedorow
Copy link
Contributor Author

Performance drop is caused by call of create_NIDs function.
It is true even if I define it like this
(which is similar in context of missing_NIDs having 0 elements):

__attribute__((noinline))
static int create_NIDs() {
    int i;
    asm("");
    return 1;
}

@marcfedorow
Copy link
Contributor Author

Not sure this will be investigated any further so I close this ticket.

marcfedorow added a commit to marcfedorow/gost-engine that referenced this issue May 24, 2024
This improves performance of scalar-optimized code by 1.5 times as well as fixes gost-engine#433.
marcfedorow added a commit to marcfedorow/gost-engine that referenced this issue May 24, 2024
This improves performance of scalar-optimized code by 1.5 times as well as fixes gost-engine#433.
marcfedorow added a commit to marcfedorow/gost-engine that referenced this issue May 24, 2024
This improves performance of scalar-optimized code by 1.5 times as well as fixes gost-engine#433.
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 a pull request may close this issue.

2 participants