Skip to content

Calculate memory footprint of cuckoo filter #11

@ajaybodhe

Description

@ajaybodhe

Hello,
How can I calculate memory footprint of the cuckoo filter, I am creating.
I am benchmarking this implementation against bloom filter here:

What I am interested is

  1. Time taken to insert 500,000 strings
  2. Time taken to lookup 1.000,000 strings, out of which 500,000 are the inserted above. So FP will be checked as well
  3. Memory footprint

So I need to know how much memory the
type CuckooFilter struct {
buckets []bucket
count uint
}

consumes.

What I am trying:
func (cf *CuckooFilter)GetSize() uintptr {
return unsafe.Sizeof(cf.count) + unsafe.Sizeof(cf.buckets) + uintptr(len(cf.buckets) * 24) + uintptr(len(cf.buckets) * 24 *4)
}

It is shown to be 15mb, may be because each slice element in golang takes 24 bytes additional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions