Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Unnecessary load on Memories.wrap #8

@ahmetcanik

Description

@ahmetcanik

Validate.notIllegalArgument(buffer.isDirect(), new IllegalArgumentException(String.format("buffer.isDirect(): %b (expected: direct buffer)", buffer.isDirect())));

Second argument is executed independent of the truth value of the first one. Thus even buffer.isDirect is true, IllegalArgumentException constructor and String.format is executed. This yields unnecessary computation on CPU. An example jvisualvm CPU sampling is shown below.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions