โŒ

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

lmdb read slow when file amout is a little larger

I installed lmdb from python:

python -m pip install lmdb

Then I write images into it, I have two settings, one is inserting 6800 images, and the other is 10000 images. All the images have size of 1024x2048, and they are in png format, and my memory size is 1T.

Here is part of the code piece with which I read images from it:

  def init_lmdb(self):
        self.env = lmdb.open(
                self.file_root,
                map_size=2**40,
                readonly=True,
                max_readers=512,
                readahead=False,
                )

    def get_bins(self, inds):
        im_bins = []
        with self.env.begin(write=False) as txn:
            for ind in inds:
                impth = self.im_paths[ind]
                im_bin = txn.get(impth)
                im_bins.append(np.frombuffer(im_bin, dtype=np.uint8))
        return im_bins

I used identical code to read from the two lmdb files, I found that the first lmdb with 6800 images needs about 9s to read 6400 images in random order, while the second lmdb with 10000 images requires 16s to read same amount of images in random order.

Would you tell me what is the cause of the difference ?

PS: I do not read images for only once. Actually, I read from only half of the images. For the lmdb with 6800 images, I only read from the 3400 of them. Also, for the lmdb with 10000 images, I only read from the subset of 5000 images. The images are read in random order, and images can be read more than one time. Until the total amount of read reaches 6400, I tested the time.

Focus checkbox mdb5?

I used mdb 5 class: mdbCheckbox, It's creates a circle around the checkbox when I click on it (or the text next to it) and it leaves the circle around it until after I click on the screen to take the focus off. I want it to show the circle only at the moment of the mouse click

.name class:focus:hover { display: none !important; } This is the best case I could come up with but it's not good enough

โŒ
โŒ