Giter Site home page Giter Site logo

Optimize uuid codecs about uuid-creator HOT 1 CLOSED

f4b6a3 avatar f4b6a3 commented on May 10, 2024
Optimize uuid codecs

from uuid-creator.

Comments (1)

fabiolimace avatar fabiolimace commented on May 10, 2024

Optimized base-n codecs

  • Base16Codec
  • Base32Codec
  • Base32HexCodec
  • Base32CrockfordCodec
  • Base64Codec
  • Base64UrlCodec

Optimized other codecs

  • StringCodec
  • NcnameCodec
  • SlugCodec
  • UriCodec

Other changes

  • Changed BaseN
  • Removed BaseNAlphabet
  • Changed BaseNEncoder
  • Changed BaseNDecoder
  • Created immutable CharArray
  • Created immutable LongArray
  • Added doc/DCE-1.1_RPC_UUID.html
  • Updated test cases

Benchmark BEFORE optimization (v3.6.0)

Benchmark                  Mode  Cnt      Score     Error   Units
Throughput.decode_base16  thrpt    5   1329,156 ±   8,629  ops/ms
Throughput.decode_base32  thrpt    5    878,372 ±  16,539  ops/ms
Throughput.decode_base64  thrpt    5    535,601 ±   4,441  ops/ms
Throughput.encode_base16  thrpt    5  16135,294 ± 121,771  ops/ms
Throughput.encode_base32  thrpt    5  17459,509 ± 113,893  ops/ms
Throughput.encode_base64  thrpt    5  19427,255 ± 277,149  ops/ms

Benchmark                  Mode  Cnt      Score     Error   Units
Throughput.decode_ncname  thrpt    5    515,425 ±   4,243  ops/ms
Throughput.decode_slug    thrpt    5    531,003 ±   4,578  ops/ms
Throughput.decode_string  thrpt    5  10349,750 ± 152,409  ops/ms
Throughput.decode_uri     thrpt    5   8032,257 ±  56,649  ops/ms
Throughput.encode_ncname  thrpt    5   9666,939 ± 202,229  ops/ms
Throughput.encode_slug    thrpt    5  17833,465 ± 501,165  ops/ms
Throughput.encode_string  thrpt    5  21366,046 ± 216,510  ops/ms
Throughput.encode_uri     thrpt    5   2864,692 ±  37,637  ops/ms

Benchmark AFTER optimization (> v3.6.0)

Benchmark                  Mode  Cnt      Score     Error   Units
Throughput.decode_base16  thrpt    5   3222,914 ±  33,809  ops/ms
Throughput.decode_base32  thrpt    5   2537,134 ±  47,252  ops/ms
Throughput.decode_base64  thrpt    5   1758,213 ±  16,912  ops/ms
Throughput.encode_base16  thrpt    5  18551,661 ± 429,523  ops/ms
Throughput.encode_base32  thrpt    5  19522,694 ± 260,718  ops/ms
Throughput.encode_base64  thrpt    5  22156,893 ± 219,649  ops/ms

Benchmark                  Mode  Cnt      Score     Error   Units
Throughput.decode_ncname  thrpt    5   1703,910 ±   6,322  ops/ms
Throughput.decode_slug    thrpt    5   1603,126 ±  20,051  ops/ms
Throughput.decode_string  thrpt    5  10377,743 ±  86,326  ops/ms
Throughput.decode_uri     thrpt    5   7954,467 ±  83,632  ops/ms
Throughput.encode_ncname  thrpt    5   7076,385 ±  79,923  ops/ms
Throughput.encode_slug    thrpt    5  19747,374 ± 194,295  ops/ms
Throughput.encode_string  thrpt    5  21746,800 ± 268,137  ops/ms
Throughput.encode_uri     thrpt    5   2934,557 ±  36,493  ops/ms

from uuid-creator.

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.