From: Eduard D. <ed...@fr...> - 2020-12-21 06:50:36
|
ok, fair enough, the reason I ask these questions is because performance worries me, I have several optimized dictionary applications where querying 66000 articles takes ± 1s. I find this slow. db/jpa/ee/jax-rs applications I build run way faster on more data. So, now I am exploring options I have to make exist-db apps run faster, apart from cache on server and/or client or faster machine. I followed all the exist-db docs and tips on performance, used monex, build indexes, etc. It just isn't fast enough. That is why I am wondering about the underlying java processing of xquery and the influence I have there. But alas the java processing is carefully hidden. Perhaps I should experiment with basex, see if that is faster. But I'd rather stick to exist-db, also because of teipublisher. Regards, Eduard -----Original Message-----From: Jean-Paul Rehr <re...@gm...>To: Eduard Drenth <ed...@fr...>Cc: exi...@li... <exi...@li...>Subj ect: Re: [Exist-open] static variables?Date: Sun, 20 Dec 2020 15:13:20 +0100 >xquery has no static Indeed. But as I tried to describe in my use case, I use this method for assigning values which are in effect static across my application (not static in programming terms). For example: let $globalvar:datastring := "/db/apps/myapp/data" But I would not do this: let $globalvar:somedoc := doc( "/db/apps/myapp/data/mydoc.xml") unless I was sure that the underlying document was not going to be changed elsewhere at the moment the variable was being used. I use this method for config files that rarely change. (For me, this is an issue of concurrent changes to a file, not really a question of processing cost.) The above may not be useful practice for your context, but in my applications it is as effective as the cache... Cheers, JPR On Sun, Dec 20, 2020 at 2:23 PM Eduard Drenth < ed...@fr...> wrote: > Thanks, but, xquery has no static. And if I do > > declare variable $x := mod:func(); > > either or not in an imported module, > > mod:func() gets executed with every request I suspect, but correct me > if I am wrong. > > Regards, Eduard > > -----Original Message----- > From: Jean-Paul Rehr <re...@gm...> > To: Eduard Drenth <ed...@fr...> > Cc: exi...@li... < > exi...@li...> > Subject: Re: [Exist-open] static variables? > Date: Sun, 20 Dec 2020 13:03:35 +0100 > > I accomplish this with a module that just has my "global variables" > for use across the application. This "global variable" module is > literally only populated with static variables which I can then > declare and import as needed in my queries. I keep a lot of static > configuration data and reusable path strings in them..... > > On Sun, Dec 20, 2020 at 12:45 PM Eduard Drenth < > ed...@fr...> wrote: > > Dear all, > > > > For performance reasons I want to be able to work with static > > variables. My data in exist is readonly. > > > > I get the impression that variables are evaluated on every request > > normally, so if I do: > > > > declare variable $teidictjson:data := .... > > > > this variable is request scoped. Can I somehow make that static or > > application scoped? Or is the cache module the only way? > > > > Bye, Eduard > > -- > > Eduard Drenth, Software Architekt > > > > ed...@fr... > > > > Doelestrjitte 8 > > 8911 DX Ljouwert > > +31 58 234 30 47 > > +31 62 094 34 28 (privé) > > > > skype: eduarddrenth > > https://github.com/eduarddrenth > > frisian.eu > > gpg: https://pgp.surfnet.nl/pks/lookup?search=eduarddrenth > > > > > > Op freed bin ik thús/wurkje ik minder > > > > > > > > > > _______________________________________________ > > > > Exist-open mailing list > > > > Exi...@li... > > > > https://lists.sourceforge.net/lists/listinfo/exist-open > > > > -- > Eduard Drenth, Software Architekt > > ed...@fr... > > Doelestrjitte 8 > 8911 DX Ljouwert > +31 58 234 30 47 > +31 62 094 34 28 (privé) > > skype: eduarddrenth > https://github.com/eduarddrenth > frisian.eu > gpg: https://pgp.surfnet.nl/pks/lookup?search=eduarddrenth > > > Op freed bin ik thús/wurkje ik minder > > > > -- Eduard Drenth, Software Architekt ed...@fr... Doelestrjitte 8 8911 DX Ljouwert +31 58 234 30 47 +31 62 094 34 28 (privé) skype: eduarddrenth https://github.com/eduarddrenth frisian.eu gpg: https://pgp.surfnet.nl/pks/lookup?search=eduarddrenth Op freed bin ik thús/wurkje ik minder |