Algorithm-PageRank-XS
view release on metacpan or search on metacpan
as you cannot do now.
* At present the indexes are "unsigned int", rather than "size_t".
Thus this will not scale with 64-bit architectures.
* It'd be nice to be able to use mmap(2) to efficiently use the hard
drive to scale to places where memory can't take us.
SPEED
This module is pretty fast. I ran this on a 1 million node set with 4.5
million arcs in 57 seconds on my 32-bit 1.8GHz laptop. Let me know if
you have any performance tips.
Below are the tables for the current iteration in trials per second and
arcs per second. Keep in mind that for some of these there are large
numbers of arcs (".2%" load with "100,000" nodes means "20,000,000"
arcs!
+-----------------+-----------------+-----------------+---------------+---------------+
| test | XS trials / sec | PL trials / sec | XS arcs / sec | PL arcs / sec |
+-----------------+-----------------+-----------------+---------------+---------------+
| 10 nodes @50% | 4533.207 | 53.741 | 6890.474 | 81.687 |
| 10 nodes @100% | 3822.595 | 46.084 | 13761.342 | 165.901 |
| 1000 @10% | 4.542 | 0.120 | 18109.287 | 2390.898 |
| 1000 @50% | 1.055 | 0.031 | 21082.599 | 15720.595 |
| 1000 @100% | 0.562 | 0.016 | 56121.722 | 16301.088 |
| 100000 @.0001%* | 1.348 | | 141855.819 | |
| 100000 @.01%* | 0.217 | | 23174.341 | |
| 100000 @.1%* | 0.034 | | 344796.415 | |
| 100000 @.2%* | 0.017 | | 348070.697 | |
lib/Algorithm/PageRank/XS.pm view on Meta::CPAN
=item * We may or may not want to adjust the weighting of individual arcs, as you cannot do now.
=item * At present the indexes are C<unsigned int>, rather than C<size_t>. Thus this will not scale with 64-bit architectures.
=item * It'd be nice to be able to use C<mmap(2)> to efficiently use the hard drive to scale to places where memory can't take us.
=back
=head1 SPEED
This module is pretty fast. I ran this on a 1 million node set with 4.5 million arcs in 57 seconds on my 32-bit 1.8GHz laptop. Let me know if you have any performance tips.
Below are the tables for the current iteration in trials per second and arcs per second. Keep in mind that for some of these there are large numbers of arcs (C<.2%> load with C<100,000> nodes means C<20,000,000> arcs!
+-----------------+-----------------+-----------------+---------------+---------------+
| test | XS trials / sec | PL trials / sec | XS arcs / sec | PL arcs / sec |
+-----------------+-----------------+-----------------+---------------+---------------+
| 10 nodes @50% | 4533.207 | 53.741 | 6890.474 | 81.687 |
| 10 nodes @100% | 3822.595 | 46.084 | 13761.342 | 165.901 |
| 1000 @10% | 4.542 | 0.120 | 18109.287 | 2390.898 |
| 1000 @50% | 1.055 | 0.031 | 21082.599 | 15720.595 |
| 1000 @100% | 0.562 | 0.016 | 56121.722 | 16301.088 |
| 100000 @.0001%* | 1.348 | | 141855.819 | |
| 100000 @.01%* | 0.217 | | 23174.341 | |
| 100000 @.1%* | 0.034 | | 344796.415 | |
| 100000 @.2%* | 0.017 | | 348070.697 | |
macro. Just C<#define> the macro before including C<ppport.h>:
#define DPPP_NAMESPACE MyOwnNamespace_
#include "ppport.h"
The default namespace is C<DPPP_>.
=back
The good thing is that most of the above can be checked by running
F<ppport.h> on your source code. See the next section for
details.
=head1 EXAMPLES
To verify whether F<ppport.h> is needed for your module, whether you
should make any changes to your code, and whether any special defines
should be used, F<ppport.h> can be run as a Perl script to check your
source code. Simply say:
perl ppport.h
* data from C. All statics in extensions should be reworked to use
* this, if you want to make the extension thread-safe. See ext/re/re.xs
* for an example of the use of these macros.
*
* Code that uses these macros is responsible for the following:
* 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
* 2. Declare a typedef named my_cxt_t that is a structure that contains
* all the data that needs to be interpreter-local.
* 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
* 4. Use the MY_CXT_INIT macro such that it is called exactly once
* (typically put in the BOOT: section).
* 5. Use the members of the my_cxt_t structure everywhere as
* MY_CXT.member.
* 6. Use the dMY_CXT macro (a declaration) in all the functions that
* access MY_CXT.
*/
#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
#ifndef START_MY_CXT
( run in 0.856 second using v1.01-cache-2.11-cpan-39bf76dae61 )