[Qt-qml] patch for type resolving

matthias.ettrich at nokia.com matthias.ettrich at nokia.com
Fri Apr 16 08:04:33 CEST 2010


It's tempting to make the "detect shadowing and give error" a warning only, which is turned off when deploying on a device. 

But this would only remove *some* pointless fstats. Given that fstats on certain types of devices are slow, we should avoid them altogether.  

One solution: create qmldir files during deployment. This can be automated completely inside our yet-to-be-written deployment tool.

Matthias
________________________________________
From: Allison Warwick (Nokia-D-Qt/Brisbane)
Sent: Friday, April 16, 2010 1:45 AM
To: Ettrich Matthias (Nokia-D-Qt/Berlin); qt-qml at trolltech.com
Subject: RE: [Qt-qml] patch for type resolving

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