<p>I'm not sure this would create much overhead, but everyone's setup is different.</p>

<p>Try this test. Enable <a href="https://craftcms.com/docs/config-settings#devMode" rel="nofollow noreferrer">Dev Mode</a>, and create a test template with the following code:</p>

<pre><code>{% for section in craft.sections.getAllSections() %}
    {{ section.name }}: {{ section.getUrlFormat() }}&lt;br&gt;
{% endfor %}
</code></pre>

<p>Then load this up in a browser and look at the <a href="https://developers.google.com/web/tools/chrome-devtools/console/" rel="nofollow noreferrer">JavaScript console</a>. You should see entries starting with "Profiling Summary Report" that will list execution time, memory and total queries.</p>

<p>Running this code locally on the <a href="https://github.com/pixelandtonic/HappyLager" rel="nofollow noreferrer">Happy Lager demo site</a>, I get these results:</p>

<pre><code>Profiling Summary Report
  Time:   0.30656s
  Memory: 10,799Kb
  Total Queries: 19
</code></pre>

CC BY-SA 3.0
2017-03-01T09:52:58.160Z
2017-03-01T09:52:58.160Z
Alex Roper
<p>Are you experiencing performance issues? If not, is this overhead really an issue?</p>

<p>If it is, how about caching the global menu for a really long time? <a href="https://craftcms.com/docs/templating/cache" rel="nofollow noreferrer">https://craftcms.com/docs/templating/cache</a></p>

CC BY-SA 3.0
2017-02-28T13:28:39.603Z
2017-02-28T13:28:39.603Z
Clive Portman
<p>I have created a global menu for my website and there I have a label and an entry section selection that I use for directing when clicking.</p>

<p>However, I just need the URL of that section and loading the whole section data is way too much overhead that its not needed.</p>

<p>I have 4-5 menu items so I am loading 4-5 sections for no reason.  Imagine the overhead. </p>

<p>Can I somehow use the section selector in CMS but get only the section URL without loading all the section data?</p>

<templating><entries>
Optimizing website menu
# Optimizing website menu

(Asked by: username_0 on 2017-02-27)

I have created a global menu for my website and there I have a label and an entry section selection that I use for directing when clicking.

However, I just need the URL of that section and loading the whole section data is way too much overhead that its not needed.

I have 4-5 menu items so I am loading 4-5 sections for no reason. Imagine the overhead.

Can I somehow use the section selector in CMS but get only the section URL without loading all the section data?

**Tags:** templating, entries


---

## 2 answers

### Answer by username_1 on 2017-03-01. Score: 1

I'm not sure this would create much overhead, but everyone's setup is different.
Try this test. Enable Dev Mode, and create a test template with the following code:
{% for section in craft.sections.getAllSections() %}
    {{ section.name }}: {{ section.getUrlFormat() }}
{% endfor %}

Then load this up in a browser and look at the JavaScript console. You should see entries starting with "Profiling Summary Report" that will list execution time, memory and total queries.
Running this code locally on the Happy Lager demo site, I get these results:
Profiling Summary Report
  Time:   0.30656s
  Memory: 10,799Kb
  Total Queries: 19


---

### Answer by username_2 on 2017-02-28. Score: 1

Are you experiencing performance issues? If not, is this overhead really an issue?

If it is, how about caching the global menu for a really long time? <https://craftcms.com/docs/templating/cache>


---

