View Single Post
Old 04-13-2020, 11:59 AM   #22
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
Has that changed? I'm sure someone said it was slower. But, as I prefer GPM, that's good.
When I first implemented GPM I compiled the templates into python. That didn't work out when the formatter started being used in threads so I took it out. That could be the source of the thought that GPM is slower.

GPM will be slower for trivial templates such as "{authors}". It should be faster for things like "{authors:sublist(1,2,&)}". It will be faster for TPM templates like "{authors:'sublist($,1,2,'&')'}" because the quoted part is treated as a GPM template.
Quote:
Maybe I am thinking of using template functions.
Template functions are the fastest option, assuming that they do something more than return a metadata field. They are compiled into python executable code so the only overhead is looking up the function and passing the arguments.

Of course, the right way to answer the question is to time equivalent templates/programs, but I am too lazy.
chaley is offline   Reply With Quote