Giter Site home page Giter Site logo

Comments (7)

RokerHRO avatar RokerHRO commented on August 27, 2024

@degski Can you give a full example program that shows that 40%? I tried but did not find such big differences. :-(

from frozen.

degski avatar degski commented on August 27, 2024

@RokerHRO https://gist.github.com/degski/a10a66d12971fa5709494af1ec131a32 (it's actually 50%, table_lookup00() is faster (a lot), but is no longer comparable to the frozen_map lookup).

from frozen.

RokerHRO avatar RokerHRO commented on August 27, 2024

@degski : OMG, that is far longer than a "minimal testcase", I didn't even understand that source completely. I'll write my own test case / benchmark program… :-(

from frozen.

degski avatar degski commented on August 27, 2024

@RokerHRO LOL, You didn't ask for a "minimal testcase", you asked for a "full example program". It is, it tests the various implementations of the conversion of a hex character string to the numeric representation. It's described in the referenced blog-post. It should compile without issue on nix with gcc or clang, on win you'll probably need clang.

Now you've asked for a minimal test case, I'll put one together and alert you to it.

from frozen.

degski avatar degski commented on August 27, 2024

@RokerHRO I've stripped all the garbage out, here it is: https://gist.github.com/degski/accd357a6f5c93c70d4e623a40b160c4 . What these functions do is described here https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/

I realized as well that my expression of how much faster [it works in my mind, but probably not for others] is weird, when I say 40% faster, I meant to say the the said program runs in 60% of the time of the reference program. i.e. 50% means twice as fast.

from frozen.

Tradias avatar Tradias commented on August 27, 2024

Running your example under Windows using MSVC v14.27 I get the following results:

table_lookup:
sum  = 1638054990250
time = 1894
frozen_map:
sum  = 1638054990250
time = 664

For reference I compiled with FROZEN_NO_EXCEPTIONS and changed plf::nanotimer to std::chrono::high_resolution_clock-machinery, as well as __attribute__ ((noinline)) to __declspec(noinline)

from frozen.

fndry-jmg avatar fndry-jmg commented on August 27, 2024

What are the statistics for the values you quote? Is the standard deviation or measure of error small? Are we sure that the compiler is not optimizing out the test (which can be both good & bad)?

from frozen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.