Comment by zamberzand

2 years ago

The homepage still makes the claim that "[autofree] takes care of most objects (~90-100%): the compiler inserts necessary free calls automatically during compilation."

There is no citation for where this 90-100% number comes from, it seems to be pulled completely out of thin air.

Autofree, as it currently exists, cannot handle structs at all, so any program whose memory allocations consist of more than 10% structs unfortunately proves this claim false.

For a specific example, a while ago I wrote a minimax tictactoe program[1] in V, which specifically used a struct to store the board state rather than an array.

In this case, with the minimax running for 4 total moves, valgrind tells me:

  ==8518== HEAP SUMMARY:
  ==8518==     in use at exit: 2,250,360 bytes in 68,544 blocks
  ==8518==   total heap usage: 161,756 allocs, 93,212 frees, 4,762,235 bytes allocated

So only 93212/161756 allocations were freed, which is 57%.

... Now, I don't actually care that much that autofree doesn't work on structs. I think that's quite reasonable, as it's a very difficult thing to implement!

But, in my opinion, your website should really cite where this 90-100% number comes from, i.e. which benchmarks were used to generate it, so that it is clear that it isn't just completely made up.

(As it currently stands, I would argue this is false advertising specifically because there's no citation for this number!)

[1]: https://pastebin.com/6ZDKKRQR

The homepage makes it clear autofree is not ready yet and recommends 3 other ways to manage memory until it is.

You create an account to post the same message in all V posts. Why? :)

  • Why isn't there a citation for this 90-100% number? I really am extremely curious where it comes from.

    As for why I am posting a similar message (not nearly the same post, though) to you here as I did a year ago:

    It is because I am very, very curious about where this number comes from and why there is no citation for it! It is fascinating to me.

    (And, more generally, I have empirical experience with autofree that many users don't seem to have... so it seems useful to post about that experience to provide extra context for everyone else on this website).