
Show HN: std::vector for c, upto 1/3 faster - tsegratis
https://tse.gratis/aArray
======
gus_massa
It would be nice to see the benchmark that support the 1/3 faster claim. I
don't doubt it, but there are always a lot of hidden assumptions and details
that are missing, that I'd like to see the _exact_ benchmark. Is it a small
vector? Is it a large vector? What happens for different vectors sizes? What
about int vs a complex struct? Too many questions ...

I'd would be better to change the license to an standard license. In the
spirit of the current license I recommend looking at the BSD license without
atribution. Try to search the different variants and pick the one that is
closer to your wishes.

It's funny to make up a license, but does your license protect you of
liabilities if a moron uses your software badly? What about if your library
has a bug? Also, someone inside a company may prefer a usual license because
the company lawyers had review the usual license, but an unusual license needs
too many talk with the lawyers to get approved.

~~~
tsegratis
Graphs are here:
[https://tse.gratis/aArray/#details](https://tse.gratis/aArray/#details)

And you're completely right, benchmarking is hard

Edit: To expand on that: I use someone else's benchmark since they have put
effort into it, and already received feedback

For std::vector and binary search I performed multiple runs on several
architectures, and did things like randomizing the benchmark order (which can
have a big impact)

Complex struct is a good question

~~~
gus_massa
Add a link to it in the main page next to the 1/3 faster claim, something like
"see the details".

(Moreover, I'd add the graph in the overview page with a link to the complete
discussion. I like graphs :) .)

~~~
tsegratis
Thankyou for your questions. They made me go back and re-test

Saving vectors between runs and comparing their contents, changes things -- to
the much more believable result of aArray being slower

Only comparing the array lengths, but not their contents probably let gcc
optimize out assignmemnts for aArray, but not std::vector -- leading to an
unfair test

Interestingly yes, std::vector now wins by a larger margin for int8_t arrays,
and int64_t becomes a tighter match

\-----

Note: I've updated the website to remove the 1/3 claim! But I can no-longer
edit the title of this thread

The remaining stool legs of aArray are safety, simplicity, and being generic
-- hopefully they don't get kicked out from under it quite so quickly ;^)

------
tsegratis
I've made it as usable/tested/documented as I can over a couple of years

Under 'how/detail/THANKS': explains internals; graphs optimizations; chat
about my life

Any feedback would be awesome ;)

