/[webpac2]/trunk/lib/WebPAC/Input.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Input.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by dpavlin, Sat Jun 25 20:23:23 2005 UTC revision 6 by dpavlin, Sat Jul 16 14:44:38 2005 UTC
# Line 5  use strict; Line 5  use strict;
5    
6  =head1 NAME  =head1 NAME
7    
8  WebPAC::Input - The great new WebPAC::Input!  WebPAC::Input - core module for input file format
9    
10  =head1 VERSION  =head1 VERSION
11    
# Line 17  our $VERSION = '0.01'; Line 17  our $VERSION = '0.01';
17    
18  =head1 SYNOPSIS  =head1 SYNOPSIS
19    
20  Quick summary of what the module does.  This module will load particular loader module and execute it's functions.
21    
22  Perhaps a little code snippet.  Perhaps a little code snippet.
23    
24      use WebPAC::Input;      use WebPAC::Input;
25    
26      my $foo = WebPAC::Input->new();      my $db = WebPAC::Input->new(
27      ...          format => 'NULL',
28            config => $config,
29            lookup => $lookup_obj,
30        );
31    
32        $db->open('/path/to/database');
33        print "database size: ",$db->size,"\n";
34        while (my $row = $db->fetch) {
35            ...
36        }
37        $db->close;
38    
39  =head1 EXPORT  =head1 FUNCTIONS
40    
41  A list of functions that can be exported.  You can delete this section  =head2 new
 if you don't export anything, such as for a purely object-oriented module.  
42    
43  =head1 FUNCTIONS  Create new input database object.
44    
45  =head2 function1    my $db = new WebPAC::Input( format => 'NULL' );
46    
47  =cut  =cut
48    
49  sub function1 {  sub new {
50            my $class = shift;
51            my $self = {@_};
52            bless($self, $class);
53    
54            $self ? return $self : return undef;
55  }  }
56    
57  =head2 function2  =head1 MEMORY USAGE
58    
59  =cut  C<low_mem> options is double-edged sword. If enabled, WebPAC
60    will run on memory constraint machines (which doesn't have enough
61    physical RAM to create memory structure for whole source database).
62    
63    If your machine has 512Mb or more of RAM and database is around 10000 records,
64    memory shouldn't be an issue. If you don't have enough physical RAM, you
65    might consider using virtual memory (if your operating system is handling it
66    well, like on FreeBSD or Linux) instead of dropping to L<DBM::Deep> to handle
67    parsed structure of ISIS database (this is what C<low_mem> option does).
68    
69    Hitting swap at end of reading source database is probably o.k. However,
70    hitting swap before 90% will dramatically decrease performance and you will
71    be better off with C<low_mem> and using rest of availble memory for
72    operating system disk cache (Linux is particuallary good about this).
73    However, every access to database record will require disk access, so
74    generation phase will be slower 10-100 times.
75    
76    Parsed structures are essential - you just have option to trade RAM memory
77    (which is fast) for disk space (which is slow). Be sure to have planty of
78    disk space if you are using C<low_mem> and thus L<DBM::Deep>.
79    
80    However, when WebPAC is running on desktop machines (or laptops :-), it's
81    highly undesireable for system to start swapping. Using C<low_mem> option can
82    reduce WecPAC memory usage to around 64Mb for same database with lookup
83    fields and sorted indexes which stay in RAM. Performance will suffer, but
84    memory usage will really be minimal. It might be also more confortable to
85    run WebPAC reniced on those machines.
86    
 sub function2 {  
 }  
87    
88  =head1 AUTHOR  =head1 AUTHOR
89    
90  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>
91    
 =head1 BUGS  
   
 Please report any bugs or feature requests to  
 C<bug-webpac-input@rt.cpan.org>, or through the web interface at  
 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebPAC>.  
 I will be notified, and then you'll automatically be notified of progress on  
 your bug as I make changes.  
   
 =head1 ACKNOWLEDGEMENTS  
   
92  =head1 COPYRIGHT & LICENSE  =head1 COPYRIGHT & LICENSE
93    
94  Copyright 2005 Dobrica Pavlinusic, All Rights Reserved.  Copyright 2005 Dobrica Pavlinusic, All Rights Reserved.

Legend:
Removed from v.1  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26