Evaluating the sum of a sparse array is slow. It appears to use an O(n^2) algorithm:
julia> @time sum(sparse(I(10000)))
0.401920 seconds (6 allocations: 176.281 KiB)
10000
julia> @time sum(sparse(I(20000)))
1.616018 seconds (8 allocations: 351.875 KiB)
20000
julia> @time sum(sparse(I(40000)))
6.819114 seconds (8 allocations: 703.500 KiB)
40000