Skip to content

Timing the vectorized pruning algorithm vs. the normal one #4

@LinguList

Description

@LinguList

I modified (refactored?) the vectorized pruning algorithm and added a more general function for the calculations in order to see how much impact the changes make.

$ time python test_pruning.py time pv

real	0m14,346s
user	0m21,164s
sys	0m22,824s

$ time python test_pruning.py time mk

real	0m1,708s
user	0m1,969s
sys	0m1,316s

$ time python test_pruning.py time prune

real	0m16,054s
user	0m23,763s
sys	0m25,403s

This shows that first, the MK (which we may not use often) is of course the fastest, as we don't have to use the scipy function and the matrix computation. The vectorized version gives us a slight gain of about 2 second for 10000 operations. Since numpy is very slow in creating arrays and matrices, I wonder if one could somehow speed this whole procedure up by preventing matrices to be created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions