Home:ALL Converter>Are Java stored procedures slower than PL/SQL in Oracle?

Are Java stored procedures slower than PL/SQL in Oracle?

Ask Time:2012-01-19T19:54:06         Author:Juan

Json Formatter

This is a straightforward question: do you know if Java stored procedures are slower than PL/SQL in a Oracle database?

We've migrated a stored procedure from PL/SQL to Java just to benchmark it and it's taking approximately two times the time of the PL/SQL one. Is this also your experience?

Thanks.

Author:Juan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/8925603/are-java-stored-procedures-slower-than-pl-sql-in-oracle
Ollie :

Whenever you switch between languages you will incur an overhead, called a context switch.\n\n( http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:60122715103602 )\n\nThere is even an overhead in moving between SQL and PL/SQL and they are very tightly integrated. Moving between Java and PL/SQL will therefore always be less efficient than pure PL/SQL.\n\nJava Stored Procedure Vs PL/SQL Stored Procedure\n\nAs for the performance once the context switching has taken place, your benchmarking will give you the best answer but FWIW, as PL/SQL is so tightly integrated within the Oracle database it should perform better than the stored Java code if you are fetching data or interacting with the DB, if you are purely manipulating already fetched data, it would depend upon what you are then doing to the data and your benchmark will tell you the answer.",
2012-01-19T12:01:48
yy