Skip to content

Investigate perf improvement - static init context creation vs in method creation #280

@lu-pinto

Description

@lu-pinto

As pointed out in this review: #277 (comment) I'm not sure the impact on performance if we create a BN_CTX every time we call into the method, instead of statically initializing a context and subsequently reusing it. I suspect we should get a bit of improvement from reuse but need to lookout for race conditions as the context doesn't seem to be thread safe. From the openssl docs there seems to be some overhead of even freeing unmanaged BIGNUMs.
One could leave the caller in Java to setup the context statically through an init function and then leave management creation/usage of contexts to the executing thread.

Possibly investigate other libs that use the same kind of context from where objects are allocated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions