<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Significant Continuous Performance Hit On Android?]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1776&amp;type=atom" />
	<updated>2021-05-17T21:45:08Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1776</id>
		<entry>
			<title type="html"><![CDATA[Re: Significant Continuous Performance Hit On Android?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7472#p7472" />
			<content type="html"><![CDATA[<p>Hello.</p><p>28% without interaction is a lot.<br />If possible, send me your project by email (support@infinity-code.com), I will check why this is happening.<br />To make it clear:<br />I don&#039;t need your working project.<br />I need any temporary project where the problem manifests itself.</p><p>A long time ago there was a directive for Android, but I don&#039;t remember why I removed it.<br />Most likely there was some problem with using the mouse on android devices.<br />I added this directive again and in the next version it will contain the directive for Android.</p><div class="quotebox"><blockquote><p>HitTest() calls EventSystem.RaycastAll() which is VERY expensive.</p></blockquote></div><p>You are using UI Image Control or UI Raw Image Control, right?<br />Consider using a tileset. It&#039;s much faster and uses less memory.<br />Yes, a Raycast is needed here, but it is needed once, and the map can make several raycasts per frame.<br />Thanks for showing me this.<br />I will try to optimize this behavior.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-05-17T21:45:08Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7472#p7472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Significant Continuous Performance Hit On Android?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7471#p7471" />
			<content type="html"><![CDATA[<p>Also - Should we really be Raycasting every frame for Tool Tips on touch devices?</p><p>HitTest() calls EventSystem.RaycastAll() which is VERY expensive.</p><p>############</p><p>protected void Update()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (OnUpdateBefore != null) OnUpdateBefore();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; BeforeUpdate();<br />&nbsp; &nbsp; &nbsp; &nbsp; _screenRect = GetRect();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; int touchCount = GetTouchCount();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (touchCount != lastTouchCount)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (allowTouchZoom)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (touchCount == 1) OnMapBasePress();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (touchCount == 0) OnMapBaseRelease();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (lastTouchCount == 0) UpdateLastPosition();<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (isMapDrag &amp;&amp; !smoothZoomStarted) UpdatePosition();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (allowZoom)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UpdateZoom();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UpdateGestureZoom(touchCount);<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; lastTouchCount = touchCount;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (dragMarker != null) DragMarker();<br />&nbsp; &nbsp; &nbsp; &nbsp; else if (HitTest())<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.tooltipDrawer.ShowMarkersTooltip(GetInputPosition());<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsTooltipDrawerBase.tooltip = string.Empty;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsTooltipDrawerBase.tooltipMarker = null;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; AfterUpdate();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (OnUpdateAfter != null) OnUpdateAfter();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; UpdateLastPosition();<br />&nbsp; &nbsp; }</p><p>########</p>]]></content>
			<author>
				<name><![CDATA[Rob66]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1187</uri>
			</author>
			<updated>2021-05-17T18:52:40Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7471#p7471</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Significant Continuous Performance Hit On Android?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7470#p7470" />
			<content type="html"><![CDATA[<p>OnlineMapsControlBase.Update is currently profiling at around 28% of a frame without any user interaction.</p><p>I just thought I&#039;d ask if there&#039;s an &#039;offical&#039; way of getting it to go to sleep when it&#039;s idle before I start hacking away.</p><p>Of course, I&#039;m not completely oblivious to the idea that I might just be doing something stupid. <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Version is 3.7.6.2 and host is Unity 2020.1.13f1</p><p>Many thanks.</p><p>Rob.</p><p>Edit - </p><p>Should this also include Android ?</p><p>/// &lt;summary&gt;<br />&nbsp; &nbsp; /// Updates the map zoom for mouse wheel.<br />&nbsp; &nbsp; /// &lt;/summary&gt;<br />&nbsp; &nbsp; protected void UpdateZoom()<br />&nbsp; &nbsp; {<br />#if UNITY_IOS &amp;&amp; !UNITY_EDITOR<br />&nbsp; &nbsp; &nbsp; &nbsp; return;<br />#endif</p>]]></content>
			<author>
				<name><![CDATA[Rob66]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1187</uri>
			</author>
			<updated>2021-05-17T17:53:44Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7470#p7470</id>
		</entry>
</feed>
