oodrive / leveldb.net

LevelDB for Windows and .NET standard
Apache License 2.0
72 stars 18 forks source link

There no support to LINQ and on load after 10M rows is very slow #16

Open ednsinf opened 1 month ago

ednsinf commented 1 month ago

There no support to LINQ and on load after 10M rows is very slow please verify thanks.

internal static List<string> LoadAll()
{
    var readOptions = new ReadOptions()
    {
        VerifyCheckSums = true,
        FillCache = true 
    };
    var iterator = Instance().CreateIterator(readOptions);
    var result = new List<string>();
    iterator.SeekToFirst();   
    while (iterator.IsValid())
    {
        var key = Encoding.UTF8.GetString(iterator.Key()); 
        result.Add(key);       
        // Move to the next record
        iterator.Next();
    }
    return result;
}