Skip to content

x/sys/unix: Pwritev and Preadv always allocate #57296

@elagergren-spideroak

Description

@elagergren-spideroak

What version of Go are you using (go version)?

$ go version
go version go1.19.3 darwin/amd64

But for sys/unix:

golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

Does this issue reproduce with the latest release?

n/a

What operating system and processor architecture are you using (go env)?

n/a

What did you do?

Wrote a program that regularly calls unix.Pwritev with a similar number of discontinuous buffers.

What did you expect to see?

A way to call Pwritev without allocating a slice of Iovecs each time.

What did you see instead?

No way to do that.

I agree that using [][]byte is nicer, but unless the Preadv, Pwritev, etc. maintain a cache of Iovecs, each call necessarily allocates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions