python modul pre-import to avoid importing each time

From: Rémi Cura <remi(dot)cura(at)gmail(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: python modul pre-import to avoid importing each time
Date: 2014-06-19 14:50:41
Message-ID: CAJvUf_sv2DFCF2vzhCWk0uTFq7g7+uwmYUpzxrB5yGYiaAE1yw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hey List,

I use plpython with postgis and 2 python modules (numpy and shapely).
Sadly importing such module in the plpython function is very slow (several
hundreds of milliseconds).

I also don't know if this overhead is applied each time the function is
called in the same session.

Is there a way to pre-import those modules once and for all,
such that the python function are accelerated?

Thanks,

Cheers,
Rémi-C

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2014-06-19 15:13:40 Re: Overlapping ranges
Previous Message sunpeng 2014-06-19 14:41:58 Re: How to store fixed size images?