So far I have the 2 CGI programs that interface between the data
(PostgreSQL now) and Apache/MapServer converted to RealBasic. The
original CGIs were written in C for one and Fortran95 for the other. If
there is a speed difference, it isn't apparent. Perhaps if I were to
include timers, but C/Fortran95/RealBasic all are plenty fast enough to
do this job.
The backend programs that I am working on now are a different story
however. The backend fires a web robot that gathers new data (from the
USGS in the program I'm working on now), stores it in temporary storage,
calculates "period of record" statistics for each gage, creates a
"complete" record for 1980 to present for each gage by filling the gaps
in data using regression equations (linear, log-linear, exponential, and
power curve) it has developed for surrounding (within150 km) gages.
After that it uses the "filled" or "complete" to project flow records
and stats to location without flow gages via a modified NRCS curve
equation and a good bit of GIS based data.
The original backend is written in Fortran95 (you probably guessed that
I'm and engineer) and is WAY faster than the RB version. That said, I
should qualify a few things. The original is not working off a SQL
server ... all its data are stored in binary random access files
maintained by the Fortran based system. There is a lot of math
involved, including array processing and matrix algebra. RB is capable
of the math, but is VERY slow compared to Fortran95. Of course the
primary purpose of Fortran is math and it has native array and matrix
handling built into the language.
The reason for moving away from the Fortran based system was to convert
to a SQL server data manager to make it easier to maintain the data
(adding 1 parameter to the old system required a lot of re-programming,
OK for a prototype but not "ready for prime time"). Even though the RB
is slower (mostly due to the math and array handling requirements of the
system) it's fast enough, since updates, to this part of the system
anyway, only happen once or twice a year.
Converting to pgSQL4RB from the RB PostgreSQL plugin has sped thing up.
Don't know exactly how much since I didn't bother to finish the plugin
based app (too slow). I would estimate that the pgSQL4RB version is 2
times faster until I implemented the COPY from STDIN with pgSQL4RB where
I am writing 10 to 20 K records repeatedly. Now it's at least an order
of magnitude faster than the plugin. The difference would probably be
higher, but the bulk of the runtime is spent crunching numbers.
Oh, yeah. Don't know if it makes a difference but the developmental box
runs Slackware 11, Apache 1.3.37, PostgreSQL 8.1.5, and MapServer
4.10.0 on a Shuttle box with an AMD Athlon 2100 (I think) and 1 gig of RAM.
Jim
Post by Jason MoehlmanYour welcome!
I am happy that it worked for you.
I am interested in how it turns out also. I have one idea/need for a
CGI program in RB, but I was concerned about performance under load
so I have not taken the time to move the project forward.
Any feedback of the RB vs C version on your Apache/Linux server would
be appreciated.
Good Luck with your project.
Jason
Post by Jim PatekThanks, Jason. I could swear that we (Marc and I ) tried that several
times last night, but when I followed your instructions, it worked.
Perhaps I'll go back and see if I can figure out why it didn't work
before (what I was doing differently), but for now I'll just take the
miracle on faith and march (stumble,?) forward. Thanks again for your help.
Jim Patek
_______________________________________________
Postgresql mailing list
http://aliacta.com/mailman/listinfo/postgresql_aliacta.com