Skip to content

start should query the page size right away instead of on the first call to pageSize() #23437

@Trevor-Strong

Description

@Trevor-Strong

Just what the title says. The page size is fundamentally a constant for a given machine, so heap.pageSize() could be
implemented as a simple read from a global variable instead of needing to lookup the page size the first time its called and needing to use atomics. On every system I'm aware of, getting the page size is relatively easy to do so the startup
overhead should be minimal. This could even be done conditionally based on whether or not the user has replaced the options.queryPageSize function or not.

On Linux, at least, this is basically free since we are getting the page size from the auxiliary vector, and the start
code already iterates the entire aux vector anyways.

Metadata

Metadata

Assignees

No one assigned

    Labels

    optimizationstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions