Skip to content

Lock with object vs empty byte array? #525

@pengisgood

Description

@pengisgood

Just curious about the lock with the empty byte array, what's the benefit of an empty byte array compare to Object?

https://github.com/WeBankFinTech/Linkis/blob/4ac1a51f25d5ea451d90e59294d0c6227c124147/core/scheduler/src/main/scala/com/webank/wedatasphere/linkis/scheduler/queue/LoopArrayQueue.scala#L27

I also found a post on StackOverflow which is relevant. Mostly discussed from the byte code and serialization perspective.

Does it really matter with performance?

Any ideas from the author(probably is @enjoyyin) of this line of code?

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