Comments (7)
@degski Can you give a full example program that shows that 40%? I tried but did not find such big differences. :-(
from frozen.
@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.
@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.
@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.
@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.
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.
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)
- frozen::unordered_multiset? HOT 1
- Compilation errors in VS 2019 HOT 7
- include/frozen/map.h:114:12: error: binding reference of type 'int' to value of type 'const int' drops 'const' qualifier HOT 2
- Error when compiling the examples in the released version 1.0.0 HOT 2
- Support for std::array? HOT 2
- Warning concerning a missing constexpr HOT 3
- [Windows][VS][MSVC] Compilation failed - min / max macros HOT 2
- Add map/set final() method? HOT 5
- Status of cvector and carray
- Building tests fail because of incompatible catch2 version. HOT 1
- How to create a string key at runtime? HOT 5
- Frozen bimap? HOT 2
- Frozen constexpr map AVL tree ?
- Test compilation error HOT 5
- map::at() may return incorrect item HOT 1
- What are extended versions of `unordered_map::find`/`at` are for? HOT 1
- test_unordered_set.cpp failed to be built with gcc 12.2.0 HOT 4
- test_unordered_map.cpp: error: modification of 'ze_map' is not a constant expression; error: non-constant condition for static assertion HOT 2
- Cannot find frozen with `find_package(frozen REQUIRED)`
- CTAD issue using frozen::map HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frozen.