# Optimization question (821883)

**URL:** https://discussions.unity.com/t/optimization-question-821883/821883
**Category:** Performance & Profiling
**Tags:** Scripting
**Created:** [December 25, 2020, 9:04am UTC](https://discussions.unity.com/t/optimization-question-821883/821883 "2020-12-25T09:04:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![unity\_1236alman](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/unity_1236alman/32/327592_2.png) [@unity\_1236alman](https://discussions.unity.com/u/unity_1236alman)
#### Post date: [December 25, 2020, 9:04am UTC](https://discussions.unity.com/t/optimization-question-821883/821883/1 "2020-12-25T09:04:54Z")

</div>

Is the overlap.. method too heavy for the update? Im working on a mobile project, and the overlap should return at least 5 colliders at time. If yes, what can be a valid alternative?

---

<div class="post-metadata">

### Author: ![Antistone](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/antistone/32/372365_2.png) [@Antistone](https://discussions.unity.com/u/Antistone)
#### Post date: [December 25, 2020, 11:34am UTC](https://discussions.unity.com/t/optimization-question-821883/821883/2 "2020-12-25T11:34:28Z")

</div>

I have no specific knowledge that directly answers your question, but considering that Unity has to check collisions of all colliders every frame just for basic physics stuff, I see no obvious reason that would be a problem. Have you tried it?

---

<div class="post-metadata">

### Author: ![unity\_1236alman](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/unity_1236alman/32/327592_2.png) [@unity\_1236alman](https://discussions.unity.com/u/unity_1236alman)
#### Post date: [December 25, 2020, 2:29pm UTC](https://discussions.unity.com/t/optimization-question-821883/821883/3 "2020-12-25T14:29:28Z")

</div>

> [@Antistone](#):
>
> I have no specific knowledge that directly answers your question, but considering that Unity has to check collisions of all colliders every frame just for basic physics stuff, I see no obvious reason that would be a problem. Have you tried it?

Yes but the game is very simple, i don’t see differences

---

<div class="post-metadata">

### Author: ![csofranz](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@csofranz](https://discussions.unity.com/u/csofranz)
#### Post date: [December 25, 2020, 4:24pm UTC](https://discussions.unity.com/t/optimization-question-821883/821883/4 "2020-12-25T16:24:30Z")

</div>

I recommend you only look at specific functions if and when the Profiler indicates that there is lots of cycles lost there. Otherwise you are likely to engage in [premature optimization](https://stackify.com/premature-optimization-evil/).
