简体   繁体   English

WinRT从本地文件缓存中读取有多昂贵

[英]WinRT how expensive is reading from local file cache

I am building a winrt metro app and always seem to run into this (non?) issue. 我正在构建Winrt Metro应用程序,并且似乎总是遇到此(非?)问题。

I find myself maintaining a lot of files of cached data that I can serialize back and forth. 我发现自己维护着许多可以来回序列化的缓存数据文件。 Data retrieved from services, user selected items and so on. 从服务,用户选择的项目等中检索的数据。

The question that I always seem to have when I write the calls is: is it the accessing of the actual file (and releasing etc) that takes time/is expensive or the amount of data that needs to be serialized from it? 我在编写调用时似乎总是遇到的问题是:访问实际文件(以及释放文件等)是否需要花费时间/成本高昂,或者需要从中序列化数据量?

How much should I worry about, for example, trying to combine a couple of files that may have the same object types stored into one and then identifying the ones I need once I have the objects 'out'. 我应该担心多少,例如,尝试将几个可能存储了相同对象类型的文件合并到一个文件中,然后在我“离开”对象后确定需要的文件。

Did you ever get insufficient Memory or memory out of bounds exception . 您是否曾经获得insufficient Memorymemory out of bounds exception

Winrt lets you use the ram and the cached file upto around 70-80% of its memory . Winrt允许您使用ram和缓存的文件,最多占其内存的70-80%。 Any thing beyond that will crash the app. 除此之外的任何事情都会使应用程序崩溃。 Once you navigate away fro your page your resorces are garbage collected so thats not an issue. 一旦在页面上浏览,您的资源便会被垃圾回收,因此这不是问题。 But if you are using using for the memory stream then also it will be fine but saving large data and continiously fetching files from the data base effects system memory. 但是,如果您正在使用using作为内存流,那也可以,但是可以保存大数据并不断从数据库中获取文件,这会影响系统内存。 And since surface tablets have limited memory set so should take a bit care about large number of files :) i faced this while rendering bitmaps as loading around 100 bitmaps simultaneously into the memory threw insufficient memory exception . 而且由于Surface平板电脑的内存设置有限,因此应该对大量文件有所注意:)我在渲染位图时会遇到此问题,因为同时将大约100个位图加载到内存中会引发insufficient memory exception

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

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