Git Product home page Git Product logo

dec2hex's Introduction

Dec2Hex

a tiny library to efficienly convert decimal values to its hexadecimal representations. See benchmark results for improvements details

Improvements over standard methods

benchstat fmt.txt ours.txt
name              old time/op    new time/op     delta
Format/method-12     103ns ± 0%       15ns ± 1%   -85.54%  (p=0.000 n=10+10)

name              old speed      new speed       delta
Format/method-12  9.67MB/s ± 0%  66.86MB/s ± 1%  +591.75%  (p=0.000 n=10+10)

name              old alloc/op   new alloc/op    delta
Format/method-12     24.0B ± 0%       0.0B       -100.00%  (p=0.000 n=10+10)

name              old allocs/op  new allocs/op   delta
Format/method-12      2.00 ± 0%       0.00       -100.00%  (p=0.000 n=10+10)

benchstat formatint.txt ours2.txt 
name              old time/op    new time/op    delta
Format/method-12    40.4ns ± 1%    15.0ns ± 1%   -62.95%  (p=0.000 n=9+10)

name              old speed      new speed      delta
Format/method-12  24.8MB/s ± 1%  66.9MB/s ± 1%  +169.92%  (p=0.000 n=9+10)

name              old alloc/op   new alloc/op   delta
Format/method-12     16.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)

name              old allocs/op  new allocs/op  delta
Format/method-12      1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)

benchstat github1.txt ours2.txt 
name              old time/op    new time/op     delta
Format/method-12    2.64µs ± 0%     0.01µs ± 1%     -99.43%  (p=0.000 n=10+10)

name              old speed      new speed       delta
Format/method-12   380kB/s ± 0%  66865kB/s ± 1%  +17496.05%  (p=0.000 n=10+10)

name              old alloc/op   new alloc/op    delta
Format/method-12      704B ± 0%         0B         -100.00%  (p=0.000 n=10+10)

name              old allocs/op  new allocs/op   delta
Format/method-12      60.0 ± 0%        0.0         -100.00%  (p=0.000 n=10+10)

License

GPLv3 logo

All rights reserved to project author(s)

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Uses GPL license described below

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

See LICENSE file for full license details.

dec2hex's People

Contributors

zerjioang avatar

Watchers

 avatar  avatar  avatar

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.