thanks for you advise
But how can i do this "You might want to add properties to dumb down the
look"?
In one of my apps, I display a table of information. Among the
information is a summary statistic for every entity in the model and its
distance to the other items. This is an n^2 problem that also involves
some multiplies and a square root, so it is not cheap once there are
more that a few hundred items. On a fast machine, it can handle up to
500 or so, and the typical use case is between 100 and 500.
If the system property "com.iceweasel.avoidSlowSummaryStats" is set to
true, then it does not calculate those stats, and thus does not do a
traversal of the model.
e.g.
if (System.getPropertyValue("com.iceweasel.avoidSlowSummaryStats",
"FALSE").equalsIgnoreCase("True")){
doSlowTraversalStat();
}
Obviously, one should query the property once on startup, not every time
through the display loop or in getValue, but this is the basic idea.
If it turns out to be a major time sink, and I feel that the program is
not useful without it, then I will try to come up with a better
algorithm, such as a clustering n log n or a "compute on add" option.
This will slow down adds substantially, but that might be acceptable,
especially if I can pre-compute it for static data. This is complicated
enough, though, that I do not want to do it unless I have to.
So, by providing the property, I allow users on even marginal hardware
to use the tool even before I optimize it. They do have to know the
magic property, but if need be, I can do some groking of the hardware
itself and disable things by default. I far prefer to leave the user in
control, and giving them a magic property or preference pane is a lot
better that trying to guess what they want, and whether they prefer slow
scrolling or missing information.
Once one does provide such properties, it is not hard to move setting
them into a preference pane if they seem to be commonly used. Pref
panes are, of course, better than magic properties, but magic properties
are easy to implement in early stages, and as you move towards release,
you can migrate critical parameters to something with a UI.
I also try to provide some of the marginal parameters, like the number
of records to return from the database at a time, or whether one should
preflight the db queries for the size of the result set, as magic
properties.
In summary, by having the most expensive features of my app appear by
default, but not appear if special magic properties are set, I can
distribute a launcher file that runs the stripped down version for slow
machines.
Scott
(e-mail address removed)
Java, Cocoa, WebObjects, and Database consulting