# Julia-ism for two-dimensional map?

**URL:** <https://discourse.julialang.org/t/julia-ism-for-two-dimensional-map/10613>\
**Category:** New to Julia\
**Created:** [April 30, 2018, 4:20am UTC](https://discourse.julialang.org/t/julia-ism-for-two-dimensional-map/10613 "2018-04-30T04:20:25Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [April 30, 2018, 4:26pm UTC](https://discourse.julialang.org/t/julia-ism-for-two-dimensional-map/10613/7 "2018-04-30T16:26:00Z")

</div>

> lordie…what is this? can someone give me a pointer, please?

> [@Big overhead with the new lazy reshape/reinterpret](https://discourse.julialang.org/t/big-overhead-with-the-new-lazy-reshape-reinterpret/7635/14):
>
> I was wondering if there has been any further progress or investigation on this? I’m getting some segfaults I can’t figure out so more than ever I’m itching to be able to use reinterpret. I’ve had a very hard time figuring out what about reinterpret is even slow. Sometimes accessing individual elements seems perfectly fine, but then I’ll run it through a function or something and it’s inexplicably slow.

> PS: May I point out that ns are not comparable across computers?

Yeah, just tried on another computer, and the SVector version is just slightly faster:

```julia
julia> @benchmark orig($xset, $yset)
BenchmarkTools.Trial: 
  memory estimate: 1.31 KiB
  allocs estimate: 8
  --------------
  minimum time: 407.743 ns (0.00% GC)
  median time: 430.580 ns (0.00% GC)
  mean time: 500.106 ns (10.39% GC)
  maximum time: 6.392 μs (88.50% GC)
  --------------
  samples: 10000
  evals/sample: 206

julia> @benchmark svec($xset, $yset)
BenchmarkTools.Trial: 
  memory estimate: 1.91 KiB
  allocs estimate: 10
  --------------
  minimum time: 404.726 ns (0.00% GC)
  median time: 425.562 ns (0.00% GC)
  mean time: 544.980 ns (19.62% GC)
  maximum time: 7.589 μs (90.31% GC)
  --------------
  samples: 10000
  evals/sample: 201

```

---

_[View the full topic](https://discourse.julialang.org/t/julia-ism-for-two-dimensional-map/10613)._
