AlgebraicJulia / AlgebraicJulia/ACSets.jl

Memory allocated in vectorized operations

Đang mở
#135 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
performance
Ngôn ngữ chính
Julia
Star
36
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This is an extension of issue #121. While individual accesses and sets have been fixed, vectorized operations are still allocating significantly more than they should. Here's a MWE:

```julia
using ACSets

SchTest = BasicSchema([:V,:E], [(:v0,:E,:V)])

@acset_type Test(SchTest, index=[:v0])

s = Test()

N = 10
add_parts!(s, :V, N)
idx = add_parts!(s, :E, N)

entry = ones(Int64, N);

function add_vector(s, idx, entry)
s[idx, :v0] = entry
end

function add_loop(s, idx, entry)
for (i, id) in enumerate(idx)
s[id, :v0] = entry[i]
end
end

begin
add_vector(s, idx, entry)
add_loop(s, idx, entry)
end

@info "Using add_vector"
@time add_vector(s, idx, entry)

@info "Using add_loop"
@time add_loop(s, idx, entry)
```

As well as the results:
image

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.