简体   繁体   English

Cocoa webview:首次执行app时速度慢,然后很好

[英]Cocoa webview: Slow on first execution of app, then fine

I have an app that has a webview that works fine in xcode itself, but when I archive the app to the desktop and run it for the first time, it grinds to a halt due to high memory consumption. 我有一个应用程序,其webview在xcode本身可以正常工作,但是当我将应用程序存档到桌面并首次运行时,由于高内存消耗而停止运行。 Something to do with the page it is running. 与正在运行的页面有关。 It's only the first time. 这是第一次。 The page does not create a database or use local storage or anything of the kind. 该页面不会创建数据库或使用本地存储或任何类型的存储。 It does do a lot of ajax requests (with tiny responses). 它确实做了很多ajax请求(带有微小的响应)。

Anyway, this happens every time I archive and then open the app for the first time, but not there after. 无论如何,每次我存档然后第一次打开应用程序时都会发生这种情况,但之后就没有了。

Is there any way I can replicate this behavior in xcode? 有什么办法可以在xcode中复制这种行为吗? Make it look like it's the first time I'm executing it? 让它看起来像我第一次执行它? Because I do not get this high memory consumption in xcode ever. 因为我没有在xcode中获得这么高的内存消耗。

Here is a solution that works for me :) Set Optimization Level for release build to None . 这是一个适合我的解决方案:)将发布版本的 优化级别设置为 Then do project clean and try again :) 然后做项目清洁再试一次:)

发布版本的优化级别设置为无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM