The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Data::ULID::XS - XS backend for ULID generation

SYNOPSIS

  use Data::ULID::XS qw(ulid binary_ulid);

  # use like Data::ULID

DESCRIPTION

This module replaces some parts of Data::ULID that are performance-critical with XS counterparts. Its interface should be the same as Data::ULID, but you get free XS speedups.

Beta quality: while this module works well in general cases, it may also contain errors common to C code like memory leaks or access violations. Please do report if you encounter any problems.

FUNCTIONS

Same as Data::ULID. All functions should work exactly the same, but the generation part of ulid and binary_ulid should be XS-boosted.

BENCHMARK

Comparing speeds of Perl and XS implementations:

                        Rate   perl_text perl_binary     xs_text   xs_binary
        perl_text   109194/s          --        -68%        -83%        -88%
        perl_binary 342646/s        214%          --        -46%        -62%
        xs_text     629138/s        476%         84%          --        -31%
        xs_binary   908050/s        732%        165%         44%          --

Benchmark ran on Thinkpad T480 (i7-8650U) and FreeBSD 12.3.

SEE ALSO

Data::ULID

AUTHOR

Bartosz Jarzyna, <bbrtj.pro@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) by Bartosz Jarzyna

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.