You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@yunikorn.apache.org by "Peter Bacsko (Jira)" <ji...@apache.org> on 2023/04/28 15:10:00 UTC
[jira] [Created] (YUNIKORN-1713) Pass EventRecord as value instead of pointer
Peter Bacsko created YUNIKORN-1713:
--------------------------------------
Summary: Pass EventRecord as value instead of pointer
Key: YUNIKORN-1713
URL: https://issues.apache.org/jira/browse/YUNIKORN-1713
Project: Apache YuniKorn
Issue Type: Sub-task
Components: core - scheduler
Reporter: Peter Bacsko
Currently, we're passing around {{si.EventRecord}} objects as a pointer to a value. The idea is that by keeping just a single value in memory, we reduce copying. However, this causes heap allocations, which puts pressure on the GC, plus dereferencing also has costs.
Also, modification to a structure is reflected in the original object. We rarely want this without adequate locking.
Since this is a simple struct that is based on a protobuf definition, we should abandon heavy pointer usage and just pass it as value.
See a relevant benchmark about struct passing value vs pointer:
https://medium.com/a-journey-with-go/go-should-i-use-a-pointer-instead-of-a-copy-of-my-struct-44b43b104963
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org