--- trunk/lib/WebPAC/Input.pm 2005/06/25 20:23:23 1 +++ trunk/lib/WebPAC/Input.pm 2005/07/16 11:07:38 3 @@ -5,7 +5,7 @@ =head1 NAME -WebPAC::Input - The great new WebPAC::Input! +WebPAC::Input - core module for input file format =head1 VERSION @@ -17,27 +17,49 @@ =head1 SYNOPSIS -Quick summary of what the module does. +This module will load particular loader module and execute it's functions. Perhaps a little code snippet. use WebPAC::Input; - my $foo = WebPAC::Input->new(); - ... + my $db = WebPAC::Input->new( + format => 'NULL', + config => $config, + ); + + $db->open('/path/to/database'); + print "database size: ",$db->size,"\n"; + while (my $row = $db->fetch) { + ... + } + $db->close; -=head1 EXPORT +=head1 FUNCTIONS -A list of functions that can be exported. You can delete this section -if you don't export anything, such as for a purely object-oriented module. +=head2 new -=head1 FUNCTIONS +Create new input database object. -=head2 function1 + my $db = new WebPAC::Input( format => 'NULL' ); + +This function will load needed wrapper module and =cut -sub function1 { +sub new { + my $class = shift; + my $self = {@_}; + bless($self, $class); + + $self ? return $self : return undef; +} + +=head2 open + +=cut + +sub open { } =head2 function2 @@ -47,19 +69,42 @@ sub function2 { } -=head1 AUTHOR -Dobrica Pavlinusic, C<< >> -=head1 BUGS +=head1 MEMORY USAGE + +C options is double-edged sword. If enabled, WebPAC +will run on memory constraint machines (which doesn't have enough +physical RAM to create memory structure for whole source database). + +If your machine has 512Mb or more of RAM and database is around 10000 records, +memory shouldn't be an issue. If you don't have enough physical RAM, you +might consider using virtual memory (if your operating system is handling it +well, like on FreeBSD or Linux) instead of dropping to L to handle +parsed structure of ISIS database (this is what C option does). + +Hitting swap at end of reading source database is probably o.k. However, +hitting swap before 90% will dramatically decrease performance and you will +be better off with C and using rest of availble memory for +operating system disk cache (Linux is particuallary good about this). +However, every access to database record will require disk access, so +generation phase will be slower 10-100 times. + +Parsed structures are essential - you just have option to trade RAM memory +(which is fast) for disk space (which is slow). Be sure to have planty of +disk space if you are using C and thus L. + +However, when WebPAC is running on desktop machines (or laptops :-), it's +highly undesireable for system to start swapping. Using C option can +reduce WecPAC memory usage to around 64Mb for same database with lookup +fields and sorted indexes which stay in RAM. Performance will suffer, but +memory usage will really be minimal. It might be also more confortable to +run WebPAC reniced on those machines. -Please report any bugs or feature requests to -C, or through the web interface at -L. -I will be notified, and then you'll automatically be notified of progress on -your bug as I make changes. -=head1 ACKNOWLEDGEMENTS +=head1 AUTHOR + +Dobrica Pavlinusic, C<< >> =head1 COPYRIGHT & LICENSE