Skip to content

Commit

Permalink
Benchmark compact and uncompact
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtaylor committed Mar 11, 2024
1 parent c09fd2c commit b242a62
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/mix/tasks/benchmark.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ defmodule Mix.Tasks.Benchmark do
small_polygon = read_geojson("small_polygon.geojson")
complex_multipolygon = read_geojson("multipolygon.geojson")

{:ok, complex_cells} = H3Geo.multipolygon_to_cells(complex_multipolygon, 6)
{:ok, compacted_complex_cells} = H3Geo.compact(complex_cells)

Benchee.run(%{
"point_to_cell" => fn ->
{:ok, _cell} = H3Geo.point_to_cell(point, 6)
Expand All @@ -15,6 +18,12 @@ defmodule Mix.Tasks.Benchmark do
end,
"complex_multipolygon" => fn ->
{:ok, _cells} = H3Geo.multipolygon_to_cells(complex_multipolygon, 6)
end,
"compact" => fn ->
{:ok, _} = H3Geo.compact(complex_cells)
end,
"uncompact" => fn ->
{:ok, _} = H3Geo.uncompact(compacted_complex_cells, 6)
end
})
end
Expand Down

0 comments on commit b242a62

Please sign in to comment.