Open ronisbr opened 1 year ago
I finally could isolate the problem!
The precompilation did not help because it takes the same amount of time to load the package. Hence, there is not point in adding precompile statements, AFAIK.
All the problem comes from this structure here:
It seems that Julia v1.9 is compiling a lot of signatures, leading to this huge slowdown.
However, I could not find any good workaround beside not specializing the buffer
, which can lead to many problems.
Btw, these are the steps to reproduce the problem without requiring connection to a database:
Julia v1.6
julia> @time precompile(ODBC.Buffer, (ODBC.API.SQLSMALLINT, Int, Int, Bool))
0.556863 seconds (698.22 k allocations: 33.957 MiB, 0.74% gc time, 100.00% compilation time)
true
Julia v1.9
julia> @time precompile(ODBC.Buffer, (ODBC.API.SQLSMALLINT, Int, Int, Bool))
30.855483 seconds (21.02 M allocations: 814.780 MiB, 0.24% gc time, 100.00% compilation time)
true
Hi!
After upgrading to Julia 1.9, I see that
DBInterface.execute
is taking a lot of time to precompile in Julia 1.9. The issue is that it is happening every time in a new session:I can reproduce this behavior in two machines (Intel Xeon and M1) when connecting to a MS SQL server.
I think everything can be highly improved if a precompile statement is added to the package.