[EMAIL PROTECTED] wrote:
>
> Brett Johnson wrote:
> |
> | I realize that this makes for non-static offsets when the driver updates
> | the dispatch table, but I don't see that as a big issue. Are there drivers
> | that change the dispatch table so often that using a variable offset to do
> | so (or even a function call for that matter) would affect their performance?
>
> Yes.
Allen, is your reply based on your having done it both ways, and measuring
the difference? Or is it more of a hunch based on experience?
The reason I ask is that I've done quite a bit of work on this very subject
in our HP-UX driver. We modify the dispatch table extensively when OpenGL
state changes. We've experimented with having code all over our driver have
access directly to a static "struct" table, and we've also used a dispatching
API where the table is changed through a function (which modifies a dynamic
"array" type of dispatch table). We have found no measurable overall
performance differences between the two for any reasonable dataset. It's
true that I could write a really pathological test case that might show a
small performance difference of 10% or so, but in general, state changes are
so comparatively expensive anyway that the cost of manipulating the dispatch
table just disappears into the noise level.
> Perhaps more importantly, some existing driver code defines the
> dispatch table as a struct, so converting it to a dynamically-indexed
> array of some kind means wholesale source code changes.
This is a good argument if our objective is to be as compatible with
existing Windows ICDs as possible, but I thought that was specifically not
an objective. If it is an objective, why are we even discussing context
independent GetProcAddress?
> And if not
> designed carefully, this would reduce the amount of type-checking that
> can be done when the driver is compiled.
This is certainly true. But it sure solves a lot of other sticky problems.
Cheers!
--
Brett Johnson <[EMAIL PROTECTED]>
Workstation Systems Lab
Hewlett-Packard Company
"Politicians, like diapers, should be changed regularly,
and for the same reason."