Git Product home page Git Product logo

easyrdfparserperf's Introduction

easyRdfParserPerf

A set of tests for checking possible EasyRdf parser backends performance.

As we want to compare apples to apples each backend implementation must return data in exactly the same format and as we are considering possible EasyRdf backends, the common format is an EasyRdf\Graph instance.

Running

Run php -f test.php in the repository's main directory. It will run tests for all available implementations and data files.

This is also done automatically after every push to the repository using the GitHub Actions CI/CD.

You can see results of automatic runs here.

Remarks:

  • test.php takes a few parameters - see php -f test.php -- --help.
    • When running test.php with php -f test.php you must use -- to separate php parameters from test.php parameters. All parameters prior to -- are passed to the php and all after to test.php.

Results

A single test is a combination of a particular paraser class and test data file.

Results are a JSON table of each test metrics, e.g.:

[
    {
        "class": "EasyRdf\\ParserPerfTest\\EasyRdf",
        "dataFile": "puzzle4d_100k.ttl",
        "time": 26.795469045639038,
        "triplesCount": 109456,
        "memoryMb": 178.7421875,
        "dataFileSizeMb": 7.526865005493164
    }
]

Reports

The repository includes an R code for parsing test results and generating a simple report out of them.

This is done by the code in plots.R which is also automatically run using the GitHub Actions CI/CD.

Report is published as an GitHub Actions run artifact.

Extending

Providing additional test data

Just add a data file to the right data/{dataSize} directory.

Remarks:

  • Please indicate the data license in a comment inside a file.
  • Please indicate the correct triples count and resources (graph nodes) count of your test data by adding two triples to it:
    <https://technical#subject> <https://technical#resourceCount> "{expected graph nodes count}" .
    <https://technical#subject> <https://technical#tripleCount> "{expected graph edges count}" .
    
    • See e.g. first two triples of this test file.
    • If any of those triple isn't provided, the parsing correctness is just taken for granted.

Providing additional backends

Write a class implementing the \EasyRdf\ParserPerfTest\ParserPerfTestInterface (see here) and assure it's autoloadable (e.g. put it the EasyRdf\ParserPerfTest namespace and save it in src\EasyRdf\ParserPerfTest\YourClassName.php).

For an example please take a look at the EasyRdf class.

Implementation remarks

  • The test.php calls particular tests as separate processes and measures the memory usage with /usr/bin/time as we don't have a reliable way of doing it in the PHP. The first issue is that memory_get_peak_usage() won't work if a less memory-hungry test/parser class is run after a more memory-hungry one. The second problem is that memory_get_*usage() doesn't report memory allocated outside of the PHP (e.g. by libxml2 when parsing the RDF XML).

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.