Skip to content

Conversation

@gbaraldi
Copy link
Member

@gbaraldi gbaraldi commented Nov 7, 2023

No description provided.

@gbaraldi gbaraldi requested a review from oscardssmith November 7, 2023 17:30

# type and dimensionality specified
(self::Type{GenericMemory{kind,T,addrspace}})(::UndefInitializer, m::Int) where {T,addrspace,kind} =
if isdefined(self, :instance) && m === 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs some supporting performance analysis, since it hardly even appears in the IR after optimization

julia> code_typed(Memory{Int}, (Core.UndefInitializer, Int))
1-element Vector{Any}:
 CodeInfo(
1 ─      nothing::Nothing
│   @ boot.jl:498 within `GenericMemory`
│   %2 = (m === 0)::Bool
└──      goto #3 if not %2
    @ boot.jl:500 within `GenericMemory`
2 ─ %4 = Core.getproperty(self, :instance)::Memory{Int64}
└──      return %4
    @ boot.jl:502 within `GenericMemory`
3 ─ %6 = $(Expr(:foreigncall, :(:jl_alloc_genericmemory), Ref{GenericMemory{kind, T, addrspace}}, svec(Any, Int64), 0, :(:ccall), Core.Argument(1), Core.Argument(3), Core.Argument(3)))::Memory{Int64}
└──      return %6
) => Memory{Int64}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire thing is in the IR.

@vtjnash vtjnash added the needs nanosoldier run This PR should have benchmarks run on it label Nov 7, 2023
@vtjnash
Copy link
Member

vtjnash commented Nov 10, 2023

@nanosoldier runbenchmarks(!"scalar", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

@vtjnash
Copy link
Member

vtjnash commented Nov 11, 2023

@nanosoldier runbenchmarks(!"scalar", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

@vtjnash
Copy link
Member

vtjnash commented Nov 11, 2023

Looks like one 6X reduction and no improvements?

@KristofferC
Copy link
Member

I see quite a few improvements?

@vtjnash
Copy link
Member

vtjnash commented Nov 12, 2023

I might have missed it, since I scroll pretty fast usually. Which one?

@vtjnash vtjnash closed this Apr 16, 2024
@vtjnash vtjnash deleted the gb/memory-extra-check branch April 16, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs nanosoldier run This PR should have benchmarks run on it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants