Skip to content

Fair comparison of algorithms, memory usage #15

@nishihatapalmer

Description

@nishihatapalmer

One of the things I've learned about benchmarking search algorithms is you have to compare like with like. I see an earlier issue asking for the amount of memory used by each algorithm to be reported, and that would be very useful information to have.

I have been working on a very simple addition - a simple function that calculates how many entries can be safely used without going over a maximum memory limit, (often limited to a power of two for hash tables). I've modified a few algorithms to pick a hash table size enforcing the memory limit, and this gives much more interesting results when you know the algorithms are using roughly the same amount of memory as each other.

My technique isn't very pleasant to work with. You have to re-compile all the algorithms if you change the memory limit, as it's hard coded in memlimit.h. So I don't see this as a general PR anytime soon, but I am making use of it myself when comparing algorithms.

My purpose in raising the issue is to understand if this is something worth pursuing - would anyone else be interested in these capabilities?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions