简体   繁体   English

LocalSettings容器中可以包含多少数据

[英]How much data can be in a LocalSettings container

In one of my apps, I'm using Dexie (IndexedDb), but it's actually much slower and more troublesome than I expected it to be, and after some experimentation I'm considering switching to using LocalSettings containers 在我的一个应用程序中,我正在使用Dexie(IndexedDb),但它实际上比我预期的要慢得多,也更麻烦,在进行了一些试验之后,我正在考虑切换到使用LocalSettings容器

My first dexie table represents Items and it has about 85,000 rows, with columns Description, ItemNo, ItemCode, Category, Price and 'DealPrice' 我的第一个dexie表代表Items,它有大约85,000行,列包括Description,ItemNo,ItemCode,Category,Price和'DealPrice'

The second table is for barcodes and it has 98,000 rows with columns BarcodeNo, ItemNo and ItemCode 第二个表用于条形码,它有98,000行,其中列BarcodeNo,ItemNo和ItemCode

If I use a LocalSettings container for the items and a container for the barcodes, will that be too much data for LocalSettings to handle? 如果我对项目使用LocalSettings容器,对条形码使用容器,那么对于LocalSettings ,处理的数据是否过多?

LocalSettings do not have a specified limit, but they are actually serialized as a file in the application data folder. LocalSettings没有指定的限制,但是实际上它们被序列化为应用程序数据文件夹中的文件。 Hence I would not expect using them would be more performant than an actual database. 因此,我不希望使用它们比实际的数据库具有更高的性能。 They are more suited for things like "preferences" or configuration, which is changed or queried infrequently. 它们更适合诸如“首选项”或配置之类的事物,这些事物很少被更改或查询。 Actually, I have written about the fact that accessing settings itself has a certain cost and caching is necessary. 实际上, 我已经写过这样一个事实,即访问设置本身会产生一定的成本,并且需要缓存。

I would suggest considering SQLite or LiteDB . 我建议考虑使用SQLite或LiteDB Both should be very efficient as long as the you manipulate the data efficiently. 只要您有效地操作数据,两者都应该非常有效。

Update 更新

I didn't notice this question was tagged for winjs, not for C#. 我没有注意到这个问题是为winjs而不是C#标记的。 Both solutions suggested could be used in HTML+JS UWP app as well, but would require another layer of indirection (a C#-based Windows Runtime Component). 建议的两种解决方案也可以在HTML + JS UWP应用程序中使用,但将需要另一层间接性(基于C#的Windows运行时组件)。 In this case I would suggest trying to investigate the reason why IndexedDb is slow for you (as 100,000 entries should still be reasonably performant). 在这种情况下,我建议尝试调查为什么IndexedDb对您比较慢的原因(因为100,000个条目仍应具有合理的性能)。 IndexedDb as a native API should have great performance. IndexedDb作为本机API应该具有出色的性能。

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

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