[Qt-qml] patch for type resolving

warwick.allison at nokia.com warwick.allison at nokia.com
Fri Apr 16 01:45:33 CEST 2010


The concept itself is fine - as you say, QML doesn't really *need* an order for resolving, it just needs to be well-defined.

A potential problem with this "detect shadowing and give error" is the cost of implementing the exhaustive search - I believe the code in the "#if 1" is the added expense, yes? Basically, it means every time we look up a type during compilation, we have to look everywhere it might be to ensure it's only in one place. Amortized, this of course means double cost of look-ups. It will generally be worse than that, as the most expensive lookup is looking for a file in a directory of the importing content (such as ".") - as that actually requires an fstat if there is no qmldir.

I've not measured the absolute cost precisely - it's currently drowned out by QUrl's poor implementation. Also, since this is a *compile* time cost, it's less critical to fluid performance.

--
Warwick




More information about the Qt-qml mailing list