When it comes to back-end (server) agents, I heard that Domino 6 executes Forumla code the fastest with Java agents second and LotusScript last.
Has anyone heard of this?
Julie Kadashevich, if you are monitoring this forum, I would appreciate your thoughts on this subject.
Tx… LST
Subject: Forumla vs Java vs Lotus Script - Performance Question for Agents
I can’t speak to the performance difference between Java and LotusScript, but historically formulas have historically executed the fastest when used for equivalent tasks. The problem, of course, is that there’s a lot you can do with Java and LotusScript that you can’t do with formulas, so that’s rarely an option.
Subject: RE: Forumla vs Java vs Lotus Script - Performance Question for Agents
I have been with Notes for some 12 years and I disagree with your assertion.
Formula language is an interperated language, while LotusScript is compiled. Therefore, Formula cannot run faster than the equivalent LotusScript.
The above logic is also confirmed by my own experience.
Regards
Rolf Pfotenhauer
Subject: RE: Forumla vs Java vs Lotus Script - Performance Question for Agents
Compiled? You mean that the LotusScript source code that I compile in Designer on my Celeron laptop and replicate upto the iSeries server is compiled to machine code without any foreknowledge of the platform upon which it will run – processor instruction set, register addressing, word length, etc.?
No – it’s “compiled” in much the same way that Java or VB6 are, to an intermediate code that runs in a run-time environment. That may be JITted to machine code at run time (I’m not familiar with the inner workings of the LotusScript runtime engine), but it isn’t compiled in the sense that, say, C/C++ code would be. By the same token, @Functions are pretty much direct calls to machine-language compiled routines, passing parameters. The interpretation overhead is offset by the speed of the native code calls.
As for direct performance comparisons, they’re rather difficult to make, what? Apart from:
Call docCollection.StampAll(“Field”,value)
versus
FIELD Field := value
there are few instances where you can directly compare comparable code between Formula and LS, and even this simplest of cases isn’t directly comparable in method – only the desired outcome is the same. Does the code work on selected documents, or an “All documents in the view”? The former (along with all documents in the database) is faster in LS because you can use StampAll. All documents in the view, though, involves either a search to create a collection for StampAll or walking the view and using the much slower doc.Save(). Try adjusting the values in a date field forward one month (not 30 days, but one month). The Formula is a single line – regardless of how many values are in the field – and runs quite snappily. LS forces you to get the document, then the item, then create a NotesDateTime-filled Variant array that then needs to be looped through so you can use AdjustMonth on the individual values. Same outcome, but the run time for the LS version is a little more than double the Formula run time on the same machine and same document set (10000 docs tested).
Horses for courses, as they say…
Subject: Forumla vs Java vs Lotus Script - Performance Question for Agents
We have not run performance comparisons between formula and LotusScript/Java since their functionalities are not equivalent. LotusScript agents in some test cases appear faster then Java in some cases, but not in all test cases. The best suggestion I can give is use the best language for the job, or the one you are most comfortable with.
Subject: RE: Forumla vs Java vs Lotus Script - Performance Question for Agents
Thanks Julie for your response. I see your point concerning the different uses of formula and LotusScript/Java. So I will continue to discuss LotusScript vs Java only.
I have heard (and thus compiling the scenerios) where back-end agents written in Java appear to execute and complete faster (sometimes at 50%) than LotusScript. One example is an agent to create databases based on a template for new users.
Performance is always on our mind and since our team is having this LotusScript vs Java discussion, I thought I would ask the community for their experiences.
If you can provide any direction of where LotusScript is better suited than Java and vise versa, I would appreciate it.
Thanks alot again for your help.
… Leo
Leo St-Jacques
Health Canada
Subject: RE: Forumla vs Java vs Lotus Script - Performance Question for Agents
Our tests do not support such difference. Keep in mind that a lot of the logic - the Notes specific logic - is shared by both languages. LotusScript is much cleaner in how it does memory management than Java. Java on the other hand can support multi-threading and network operations.
To do a true comparison you would need to write identical applications in two languages, run them in indentical environments, with identical loads, with the same network load.
In our tests under heavy load LotusScript performs better than Java and we are working on addressing this for Java.