APM: Just need structs

tmcd at panix.com tmcd at panix.com
Thu Sep 13 22:53:35 PDT 2007


On Thu, 13 Sep 2007, Montgomery Conner <montgomery.conner at gmail.com> wrote:
> If you don't require encapsulation the easiest (and most efficient)
> solution would be to forgo building an object to hold this data:
> there would be no point and there is a semi-trivial amount of
> overhead in doing so.

Micro-optimization leads to micro-results.  What's going to dominate
the runtime of this program is the many many `...` and
open(IN, "...|") calls to external programs.

> You could use an array instead.

The three types of objects:
- Filespecs like //depot/dev/foo/bar.java#3
  That's a dead giveaway that it's Perforce.
- Changelist numbers like 67890
- Bug numbers like 12345

A filespec is associated with a changelist.  A changelist may be
associated with a bug.  I have to do system("p4 ...") to find out what
objects exist and their associations.  I need to be able to query
whether I've dealt with an object before, so lookup must be efficient.
There's different data that I want to store with each object type.

Filespecs obviously wouldn't work as array indices, and searching
array values would be ugly to work with.  The changelist numbers and
bug numbers could work as arrays, but I was thinking of hashes anyway.

-- 
Tim McDaniel; Reply-To: tmcd at panix.com


More information about the Austin mailing list