Git Product home page Git Product logo

itoa-benchmark's People

Contributors

amdn avatar byronhe avatar chenshuo avatar frankhb avatar jeaiii avatar jsteemann avatar lakshayg avatar miloyip avatar publicscan avatar senzhangai avatar supersodasea avatar thomasmueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

itoa-benchmark's Issues

Correctly handle most-negative integer

This function depends on undefined behavior for std::numeric_limits<int32_t>::min():

void i32toa_sse2(int32_t value, char* buffer) {
if (value < 0) {
*buffer++ = '-';
value = -value;
}
u32toa_sse2(static_cast<uint32_t>(value), buffer);
}

value = -std::numeric_limits<int32_t>::min() is not defined in C++:
http://stackoverflow.com/questions/16188263/is-signed-integer-overflow-still-undefined-behavior-in-c

I've observed g++ 4.9.1 create code that segfaults: it incorrectly enters the if (v < 10000) branch then tries to lookup gDigitsLut[d1] because d1 is too big.

Recommend:
void i32toa_sse2(int32_t value, char* buffer) {
if (value < 0) {
*buffer++ = '-';
u32toa_sse2(~static_cast<uint32_t>(value) + 1, buffer);
} else {
u32toa_sse2(static_cast<uint32_t>(value), buffer);
}
}
Same for 64.

Change time unit

Currently the time unit is millisecond per test.
It is not very intuitive as audiences need to know the test size.
I suggest to change it to nanosecond per operation. It is more intuitive and can be compared to other operation such as dtoa().

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.