# Optimization of the display function

**URL:** https://discourse.paraview.org/t/optimization-of-the-display-function/12934
**Category:** ParaView Support
**Tags:** python
**Created:** [September 26, 2023, 1:41pm UTC](https://discourse.paraview.org/t/optimization-of-the-display-function/12934 "2023-09-26T13:41:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RafaMADFT](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rafamadft/32/12344_2.png) [@RafaMADFT](https://discourse.paraview.org/u/RafaMADFT)
#### Post date: [September 26, 2023, 1:41pm UTC](https://discourse.paraview.org/t/optimization-of-the-display-function/12934/1 "2023-09-26T13:41:06Z")

</div>

Good morning, i have a question regarding a coomand used in python to show data in view:

# show data in view

```
casefoamDisplay = Show(casefoam, renderView1, 'GeometryRepresentation')

```

This command is taking around 10 minutes to execute when i run my code, moreover, when i try to display the extract blocks, take a while as well.

Do you know how to optimize it, a different command or domething to make it faster?.

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [September 27, 2023, 8:42am UTC](https://discourse.paraview.org/t/optimization-of-the-display-function/12934/2 "2023-09-27T08:42:04Z")

</div>

Well, we do not have an explicitly “slow” method and a “quick” one. So one need to investigate what exactly is long in your case.

In fact, different things occurs behind the `Show`:

1. **update** the whole upstream pipeline (if needed). In a script case, the first `Show` will trigger the reader for instance.
2. **create** the `Representation` object, i.e. prepare data for rendering. With `GeometryRepresentation`, it extracts the external surface of the mesh, create a default colormap, etc…

The `1.` can also be done with `UpdatePipeline`, so you can see which part is long.

For more timing details, you look at the execution logger. See `--log` and `--verbosity` option of paraview / pvpython. In the interface, go to `Tools / Log viewer`.

For instance

```sh
./bin/pvpython --log=output.log,TRACE

```

See also:

- [https://www.kitware.com/paraviews-advanced-logging-user-interface/](https://www.kitware.com/paraviews-advanced-logging-user-interface/)
- [New logging support in ParaView](https://discourse.paraview.org/t/new-logging-support-in-paraview/1308)
