# Poor results using WriteVTK?

**URL:** https://discourse.julialang.org/t/poor-results-using-writevtk/44570
**Category:** New to Julia
**Created:** [August 8, 2020, 1:55pm UTC](https://discourse.julialang.org/t/poor-results-using-writevtk/44570 "2020-08-08T13:55:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [August 8, 2020, 1:55pm UTC](https://discourse.julialang.org/t/poor-results-using-writevtk/44570/1 "2020-08-08T13:55:40Z")

</div>

Hello!

I have made a very simple code to save point data + one point data array:

```julia
using WriteVTK

using Random
using Test

function write_vtp(filename::String, points, attribute)

    polys = empty(MeshCell{WriteVTK.PolyData.Polys,UnitRange{Int64}}[])
    verts = empty(MeshCell{WriteVTK.PolyData.Verts,UnitRange{Int64}}[])

    # Note: the order of verts, lines, polys and strips is not important.
    # One doesn't even need to pass all of them.
    all_cells = (verts, polys)

    fname = filename * "_2D"
    vtk = vtk_grid(fname, points, all_cells..., compress=true, append=false)

    vtk["my_point_data"] = attribute;

    vtk_save(vtk)
end

function main()
    Np = 1280
    points = rand(2,Np);
    filename = "polydata"
    attribute = [randn() for i = 1, j = 1:Np];
    @time filenames = write_vtp(filename, points, attribute)
end

main()

```

Running this code though and just benchmarking using @time:

```julia
5.363723 seconds (47.69 M allocations: 1.383 GiB, 4.40% gc time)

```

Which is quite poor considering N = 1280 - I believe I am doing something wrong, but I cannot figure it out. Would anyone know why?

Kind regards

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [August 8, 2020, 2:25pm UTC](https://discourse.julialang.org/t/poor-results-using-writevtk/44570/2 "2020-08-08T14:25:22Z")

</div>

I did not do anything wrong, there seems to be some issue with my Atom version:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/6/0659cd309bcd4cc0b2c80fc94b3fe1c6a01d4159.png)

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [August 8, 2020, 2:34pm UTC](https://discourse.julialang.org/t/poor-results-using-writevtk/44570/3 "2020-08-08T14:34:31Z")

</div>

I found the mistake. Whenever I press “f5” it runs in debug mode for some reason - that is why I get that weird result. What is the shortcut for running a file without debugging in Juno?

EDIT: A temp. fix after pressing f5 is to enable this option:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/5/25d8318275f094febd9d2c9e98ced82a23f37046.png)

Then it runs as if it is without debugging
