swiftlang/swift

[SR-11418] Add Graph Algorithm benchmarks to test unowned, weak, and unmanaged

Open

#53,819 opened on Sep 4, 2019

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Swift (10,719 forks)batch import
benchmarkscompilergood first issuestandard library

Repository metrics

Stars
 (69,989 stars)
PR merge metrics
 (Avg merge 8d 17h) (510 merged PRs in 30d)

Description

Previous ID SR-11418
Radar None
Original Reporter @gottesmm
Type Task
Votes 1
Component/s Compiler, Standard Library
Labels Task, Benchmark, StarterBug
Assignee None
Priority Medium

md5: 4c8274584ae974ce398c7d395aad0770

Issue Description:

Right now IIRC we do not have any (public) benchmarks testing the performance of unowned, weak, Unmanaged. In fact when I just did a git grep for weak or unowned I did not see /any/ references in the benchmark suite. We should add new benchmarks that test the codegen here for all 3.

With that in mind, one type of benchmark that is straight forward to write to test this performance is to write graph algorithms on graphs that use non-strong pointers internally to maintain the graph edges to prevent reference cycles in the graph.

NOTE: The reason I put this in Compiler and Standard Library is b/c the missing coverage of Unmanaged in benchmarking involves missing stdlib benchmarking coverage.

Some ideas of algorithms:

1. Dijkstra Algorithm.
2. Computing the post order numbers for a graph (or providing a topological order).
3. Computing strongly connected components of a graph.

These are just some off the top of my head.

I would say we should also look at DeltaBlue but I think there is a licensing issue. If we eventually convert the benchmark suite so we only use the package toolchain, it should be easy to put DeltaBlue into a different repo and make it an optional dependency.

Contributor guide