From: HeyBub on
After getting some complaints from our users about the seeming inefficiency
of a particular process, I had a look at the code.

The programmer who wrote the code used an internal bubble sort to rearrange
the data and find duplicates. Some 3,000 entries consumed as much as two
minutes of clock time.

"Screw this," I cried. I ripped out the couple hundred lines of code
involved and replaced it with a simple ISAM file which summed the duplicates
into a single entry.

The process went from the aforementioned two minutes to FOUR SECONDS !

I considered replacing the ISAM stuff with the SORT verb, but I'm not a
fanatic about micro-efficiency.


From: Pete Dashwood on
HeyBub wrote:
> After getting some complaints from our users about the seeming
> inefficiency of a particular process, I had a look at the code.
>
> The programmer who wrote the code used an internal bubble sort to
> rearrange the data and find duplicates. Some 3,000 entries consumed
> as much as two minutes of clock time.
>
> "Screw this," I cried. I ripped out the couple hundred lines of code
> involved and replaced it with a simple ISAM file which summed the
> duplicates into a single entry.
>
> The process went from the aforementioned two minutes to FOUR SECONDS !
>
> I considered replacing the ISAM stuff with the SORT verb, but I'm not
> a fanatic about micro-efficiency.

Good stuff, Jerry!

It is a bit ironic that in this last week I too used an ISAM file as paged
storage for an internal process. The pages needed to be 8K and SQL Server
doesn't like columns that big... I also wanted the software to be
independent of the RDB so ISAM looked pretty obvious. Fortunately the pages
are completely dynamic, created as needed, deleted when their usefulness is
over, accessed randomly, and the file gets recreated every day as part of
start-up housekeeping, so issues of maintenance don't arise. It made me
smile because the whole thing is a data base application but without this
ISAM file it wouldn't work.:-)

They still have their uses.

Pete
--
"I used to write COBOL...now I can do anything."


From: Anonymous on
In article <XcadnUpx6KmgxlnWnZ2dnUVZ_uSdnZ2d(a)earthlink.com>,
HeyBub <heybub(a)NOSPAMgmail.com> wrote:
>After getting some complaints from our users about the seeming inefficiency
>of a particular process, I had a look at the code.
>
>The programmer who wrote the code used an internal bubble sort to rearrange
>the data and find duplicates. Some 3,000 entries consumed as much as two
>minutes of clock time.

Hmmmm... this sounds like it could have any one of a variety of causes,
including (but not limited to) 'Look, Ma, I'm a Programmer!' code to 'Oh,
there'll *never* be more than a couple of those' to 'Yes, you can do that
in an external SORT step... but (Corner-Office Idiot) doesn't like
external SORTs so you'll have to code it inline'.

>"Screw this," I cried. I ripped out the couple hundred lines of code
>involved and replaced it with a simple ISAM file which summed the duplicates
>into a single entry.
>
>The process went from the aforementioned two minutes to FOUR SECONDS !
>
>I considered replacing the ISAM stuff with the SORT verb, but I'm not a
>fanatic about micro-efficiency.

I'd say you are fortunate to be working in a shop where such techniques
are permitted... our experiences, of course, might be different but I have
worked in places where adding another file to a program required so much
Committee Overview (a holdover, most likely, from the Dayse of Punch-cards
and mechanical collators) that the consensus was 'just don't do it, find
another way...

.... have you thought about internally coding a bubble sort?'

(I have some fairly recent code (written seven years ago, last
compiled five years ago) running in Production using a comb sort routine
provided by Mr Moseley, similar to that found in
<http://www.jaymoseley.com/hercules/download/misc/combsort.tgz> )

DD

From: Howard Brazee on
On Tue, 13 Apr 2010 12:11:28 +0000 (UTC), docdwarf(a)panix.com () wrote:

>... have you thought about internally coding a bubble sort?'
>
>(I have some fairly recent code (written seven years ago, last
>compiled five years ago) running in Production using a comb sort routine
>provided by Mr Moseley, similar to that found in
><http://www.jaymoseley.com/hercules/download/misc/combsort.tgz> )

I have coded internal comb sorts, because my version of CoBOL doesn't
do table sorts. It's not very complicated (and structured
programming makes it so that maintenance programmers don't really need
to look at those paragraphs), and it's quick. That said, if I had a
table sort, I would have used it.

--
"In no part of the constitution is more wisdom to be found,
than in the clause which confides the question of war or peace
to the legislature, and not to the executive department."

- James Madison
From: Anonymous on
In article <9jr8s5h5758kq1mi63242n83s0i7ehjlqs(a)4ax.com>,
Howard Brazee <howard(a)brazee.net> wrote:
>On Tue, 13 Apr 2010 12:11:28 +0000 (UTC), docdwarf(a)panix.com () wrote:
>
>>... have you thought about internally coding a bubble sort?'
>>
>>(I have some fairly recent code (written seven years ago, last
>>compiled five years ago) running in Production using a comb sort routine
>>provided by Mr Moseley, similar to that found in
>><http://www.jaymoseley.com/hercules/download/misc/combsort.tgz> )
>
>I have coded internal comb sorts, because my version of CoBOL doesn't
>do table sorts. It's not very complicated (and structured
>programming makes it so that maintenance programmers don't really need
>to look at those paragraphs), and it's quick. That said, if I had a
>table sort, I would have used it.

In the words of the Oldene Dayse, Mr Brazee, 'If my Grannie had wheels
she'd be a trolley-car'. Even as recently as '03 the IGYCRCTL compiler
(to the best of my knowledge) did not support table sorts... I seem to
recall that the version of Microfocus I worked with (1.8.something?) did.

DD