[GRASS-dev] t.list slow

Sören Gebbert soerengebbert at googlemail.com
Sun Oct 18 04:42:38 PDT 2015


Hi Radim,
the reason why t.list and many other t.* modules are "slow" is the
initialization of the temporal framework. Several background processes
are started and the temporal databases are checked for each mapset in
the mapset searchpath.

You have to use the GRASS GIS temporal framework directly to make it
faster, so that the temporal framework is only initiated once and not
every time a t.* module is called.
I have implemented such a functionality here:
 https://bitbucket.org/huhabla/grass-data-explorer/src/03e2fc5b74da163a2da5bfedca664afb542c4077/grassdataexplorerdialog.py?at=master&fileviewer=file-view-default#grassdataexplorerdialog.py-739

The function from the temporal framework is: tgis.get_dataset_list()
This should be almost as fast as the direct sqlite interface.

Best regards
Soeren

2015-10-18 13:15 GMT+02:00 Radim Blazek <radim.blazek at gmail.com>:
> Hi,
> I found t.list module to be quite slow, about 500ms. Simple "select *
> from strds_absolute_time;" takes about 8ms with sqlite3 or db.select.
> If I want to get list of more types for more mapsets (for example
> mapsets which are not in SEARCH_PATH) it takes seconds.
>
> Is there a chance to make it faster?
>
> Radim


More information about the grass-dev mailing list