Skip to content

Commit 22b0153

Browse files
authored
Merge pull request #118 from invenia/print_matrix-benchmark
Add benchmark for limited print_matrix (Julia PR 23681)
2 parents c0b0675 + a4c1905 commit 22b0153

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/io/IOBenchmarks.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ testdata_buf = serialized_buf(testdata)
5959
g["serialize", "Matrix{Float64}"] = @benchmarkable serialize(io, $testdata) setup=(io=IOBuffer())
6060
g["deserialize", "Matrix{Float64}"] = @benchmarkable (seek($testdata_buf, 0); deserialize($testdata_buf))
6161

62+
###################################
63+
# limited array printing (#23681) #
64+
###################################
65+
66+
g = addgroup!(SUITE, "array_limit", ["array", "display"])
67+
68+
test_vector = rand(10^8)
69+
test_column_matrix = reshape(test_vector, length(test_vector), 1)
70+
test_square_matrix = reshape(test_vector, 10^4, 10^4)
71+
disp = TextDisplay(IOContext(devnull, :limit=>true))
72+
73+
for A in (test_vector, test_column_matrix, test_square_matrix)
74+
g["display", "$(typeof(A))$(size(A))"] = @benchmarkable display($disp, $A)
75+
end
76+
77+
###################################
78+
6279
function perf_skipchars_21109()
6380
mktemp() do _, file
6481
println(file, "G")

0 commit comments

Comments
 (0)