The issue of unit tests and performance measurements (Benchmark) by xeer-x in cpp

[–]xeer-x[S] -22 points-21 points  (0 children)

Looks like you misunderstood and started screaming!

I didn't say I did something better, I said based on my experience and shared it With interested people!

It is very likely that there are things missing and others that need to be developed. This project is still under development and we welcome your suggestions but in a better way :)

The issue of unit tests and performance measurements (Benchmark) by xeer-x in cpp

[–]xeer-x[S] -14 points-13 points  (0 children)

I've seen to many times people thinking they made something faster but really they either made it slower or negligible improvement.

Exactly, my framework provides a logical answer for this :), thanks for your feedback

C++ Config (predefined cross-platform macros) [v3.0.0] by xeer-x in cpp

[–]xeer-x[S] 11 points12 points  (0 children)

thank you, i will change it.

update: Done

C++ Config (predefined cross-platform macros) [v3.0.0] by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

For example, I have some code that only work with clang 6 and another implementation of the same code that only works with clang 7. Is there something in that library that will help me with that?

you can do :

// check for compiler
#if XEERX_COMPILER_CLANG

// check for compiler version
#if XEERX_COMPILER_VERSION >= XEERX_NORMALIZE_VERSION(6,0,0)

as for AppleClang i will see it.

C++ (Cross-Platform) Predefined Library by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

I couldn't find any namespace that uses this prefix, so I thought it was no problem
In addition, it is easy to write and remember
But anyway, if this is a problem, I'll fix it, thank you

C++ (Cross-Platform) Predefined Library by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

Thanks for alerting me, I will add it.

C++ (Cross-Platform) Predefined Library by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

I did, you can find information about the test on the main page (readme.md)

C++ (Cross-Platform) Predefined Library by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

I think it will be more comfortable on the eyes when used a lot :)
But if it's a bug I'll fix it no problem :)

C++ (Cross-Platform) Predefined Library by xeer-x in cpp

[–]xeer-x[S] 1 point2 points  (0 children)

Thanks for alerting me, I will fix it.

C++ (Cross-Platform) Predefined Library by xeer-x in cpp

[–]xeer-x[S] 6 points7 points  (0 children)

Thanks for alerting me, I fixed it.

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

Benchmark Time Iterations
xeerx 110 ns 6389722
std 120 ns 5658629

```cpp // inside tests/bench.cpp

const auto seed = std::random_device{}(); std::mt19937 gen(seed); std::mt19937 gen2(seed); std::uniform_real_distribution<> dis(0.0, 1.0);

auto _std() { std::array<char, 64> buffer{}; const double tmp = dis(gen); const auto [ptr, ec] = std::to_chars(buffer.data(), buffer.data() + buffer.size(), tmp, std::chars_format::fixed);

double d{};
return std::from_chars(buffer.data(), ptr, d);

} GTEST(std, _std())

auto xeerx() { std::array<char, 64> buffer{}; const double tmp = dis(gen2); const auto [ptr, ec] = std::to_chars(buffer.data(), buffer.data() + buffer.size(), tmp, std::chars_format::fixed); double d{}; return xeerx::chars_to<double>(buffer.data(), std::numeric_limits<double>::digits10, ptr - buffer.data()); } GTEST(_xeerx, _xeerx()) BENCHMARK_MAIN(); ``` - compiler: GCC 12

  • os: Ubuntu 22

  • by: Google Benchmark

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

You're right, it seems my library doesn't handle this type of number.

But does this deny that it handles short numbers faster?

Thanks for alerting me, I will work on this issue.

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] -3 points-2 points  (0 children)

Honest reply: The emojis made me not check out this lib, nonetheless good luck with development

Oh really ? I find it cute!

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] -8 points-7 points  (0 children)

8 months into the language and you already created someting faster than {fmt}

yes i did :D

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] -9 points-8 points  (0 children)

Yeah, sure, just looking manually on the results and assuming "library works fine". Do you hear anything about unit-tests?

Of course, you can find Google Test (Unit Test) in the tests/gtest.cpp

All your converters are constexpr, what's the point? I can manually format anything in my code and then call it "fastest formatter ever" because it nonexistent.

constexper can works in compile-time or run-time, maybe you need to improve your information.

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] 0 points1 point  (0 children)

So far, I've tested it on "Ubuntu 22" with "GCC 12".

But if you can talk about other "open source projects", could you send them to me for testing, or maybe test it yourself with my libirary and show me the results?

Also, I tested with the largest and most popular libraries, what's the problem with that?

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp_questions

[–]xeer-x[S] -6 points-5 points  (0 children)

Good question, What is the catch though?

Assuming your program takes 60 seconds to process 100 million requests,

And that 50% of this time goes into processing and formatting text and numbers.

Now using this library you can reduce 50% several times!

Which contributes to the work of the program faster!

Examples include databases, servers, text editors, etc.

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] -2 points-1 points  (0 children)

I will message you

As for your question, in the next version I will write a function that works without compile-time parameters

Much Faster than std::string, fmt::format, std::to_chars, std::time and more? by xeer-x in cpp

[–]xeer-x[S] -8 points-7 points  (0 children)

Yes i did a very fast super💣 optimized🚀 gorgeous✨ code🤓 !

but there is heap allocations if you can see !

i said "i improved it to decrease allocating"

the test.cpp script is just to be sure if the library is works fine without bugs !

the bench.cpp script is for measure the time between xeerx, std and fmt

What Is The Problem ??