문제

right now i have a bottle neck in my program I'm trying to write. i am trying to use a pinch gesture to control the scale of a UIImage. its the calculation of the scale that is causing the program to slow down and become choppy. below is the equation.

currentScale = (currentDistance / initialDistance) * scaleMod;

scaleMod is what ever the current scale was the user took their fingers off the screen. so the next time the user does a pinch the old scale is essentially the starting point of the new scaling action.

도움이 되었습니까?

해결책

문제는 / PWA가 실제로 관리되는 경로 일 것입니다.사이트 모음을 새 관리 경로로 복사하여 먼저 Explicit inclusion로 만들어야합니다.

다른 팁

For any type of the three vars, this calculation can easily be done millions of times per second with little performance impact. Your problem is elsewhere.

예, 서버 추가 옵션입니다.아마 많은 콘텐츠를 크롤링하거나 사용자가 쿼리로드를 만들고 있습니다.검색을 별도의 응용 프로그램 서버로 이동시키는 것을 고려하십시오.

사용자 경험에 영향을 줄 수 있기 때문에 프런트 엔드 서버에서 검색 및 다른 자원 소비 서비스를 실행하는 것이 좋습니다.

응용 프로그램 서버에 모든 서비스를 넣을 필요가 없습니다.일부는 프런트 엔드 서버 (Excel Services, User Profile)에서 실행할 수 있습니다.모두 서버 성능 및로드에 따라 다릅니다.

MS에서 SP2013의 아키텍처를 살펴보십시오.SP2010에 대한 (매우 유사) : http : // www.microsoft.com / ko-us / download / confirmation.aspx? ID= 37000

You could store scaleMod / initialDistance. When scaling is active (the user's fingers are still on the screen), multiply that value by currentDistance as needed.

Once the user has finished pinching, store the new scaleMod / initialDistance value for the next time pinching happens.

if you are doing computation with int (or other integer), see if he can do it using float precision. Floating-point divide is faster than integer (fewer bits to divide, assuming your CPU) has floating-point unit).

also, try to factor out division as multiplication by a reciprocal.

Check that InitialDistance != 0 first! :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top