NAME

PERLANCAR::Tree::Examples - Generate sample tree object

VERSION

This document describes version 1.000 of PERLANCAR::Tree::Examples (from Perl distribution PERLANCAR-Tree-Examples), released on 2016-04-01.

SYNOPSIS

use PERLANCAR::Tree::Examples qw(gen_sample_tree);

my $tree = gen_sample_tree(size => 'medium1');

DESCRIPTION

This distribution can generate sample tree objects of several size (depth + number of nodes) and implementation (hash-based nodes or array-based). I use these example trees for benchmarking or testing in several other distributions.

FUNCTIONS

gen_sample_tree(%args) -> obj

Generate sample tree object.

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • backend => str (default: "hash")

  • size* => str

    Which tree to generate.

    There are several predefined sizes to choose from.

    tiny1 is a very tiny tree, with only depth of 2 and a total of 3 nodes, including root node.

    small1 is a small tree with depth of 4 and a total of 16 nodes, including root node.

    medium1 is a tree of depth 7 and ~20k nodes, which is about the size of Org::Document tree generated when parsing my todo.org document circa early 2016 (~750kB, ~2900 todo items).

Return value: (obj)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/PERLANCAR-Tree-Examples.

SOURCE

Source repository is at https://github.com/perlancar/perl-PERLANCAR-Tree-Examples.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=PERLANCAR-Tree-Examples

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by perlancar@cpan.org.

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