Calling Python Functions from Java (Without Jython, because it is too slow.) -


i need able call python functions java, , return of functions, should primitives only.
i don't need access java objects in python or other stuff that.
but, of all, need speed. need able load script @ start of application , call functions @ different time-intervals, can tiny (30-40 times per second).
that's main-reason why don't think jython work me: has kinds of stuff don't need, , incredibly slow.

so, constraints/requirements have:

  • needs fast
  • i need call python functions , result
  • the script should loaded once

do guys know way call python functions in pre-loaded script (so script not have loaded again , again each function call)?

(ps: not think duplicate searched quite lot , links found did not answer question (for example calling python in java?) )

you write jni code embed cpython interpreter.

you write python program run daemon (or web service or whatever) , connect via sort of networking. intentionally vague here since such broad question number of possibilities.

i don't know either of above faster calling in jython. note can load jython interpreter once , (re)use each function call.

what if rewrote python function in java? can load dynamically, if reason trying combine multiple languages. alternatively, java8 comes (new) javascript engine. use javascript instead of python.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -