LevelDB. NET performance test,

Source: Internet
Author: User

LevelDB. NET performance test,

Recently learned about LevelDB, found that the embedded K-V data performance is good, so by the way want to know about the use level. because LevelDB is also targeted. net implementation, so it is targeted at LevelDB. NET to perform a simple read/write stress test. in order to more objectively reflect the test structure, a large amount of data is added, and a random KEY is used during the GET operation.

Set operation
?
 
 
1234567891011121314151617181920 public static void WriteTest(object state)        {            while (true)            {                 User user = new User();                string id = GetKey().ToString("000000000000000000000");                user.Name = id;                user.EMail = id + "@msn.com";                user.CrateTime = DateTime.Now;                user.City = "GZ" + id;                user.Country = "CN" + id;                user.Address = "sdfffffffffffffffffffffffffafjsdfjsljfsjfls"+id;                user.Phone = id;                user.Region = "gd";                db.Set(user.Name, user);                System.Threading.Interlocked.Increment(ref mCount);             }        }

Get operation
?
 
 
12345678910111213141516 while (true)            {                User user;                 int index = ran.Next(100000, 500000);                if (index == li)                {                    Console.WriteLine(index);                }                li = index;                 user = db.Get<User>(index.ToString("000000000000000000000"));                System.Threading.Interlocked.Increment(ref mIndex);                System.Threading.Interlocked.Increment(ref mCount);             }

Summary

LevenDB. net write speed is very efficient, in the case of a single thread write can reach nearly 5 W/second efficiency, in terms of obtaining efficiency, the concurrent reading of five threads can reach the capability of 15 W/second .... this reading effect is quite impressive.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.