32-bit vs 64-bit DLL
A 32-bit and a 64-bit version of the DLL are provided. The following table illustrates the differences between the DLL versions.
32-bit DLL |
64-bit DLL |
---|---|
Can be used in both 32- and 64-bit versions of Python |
Can only be used in 64-bit Python |
When used in 64-bit Python, the fit will take longer [1] |
There is no performance overhead |
Limited to 4GB RAM |
Can access more than 4GB RAM |
Can load a 32-bit user-defined DLL function [2] |
Can load a 64-bit user-defined DLL function [2] |
If loading the 32-bit DLL in 64-bit Python, it is important to reduce the number
of times a Model
is created to fit data. In this case,
creating a Model
object takes about 1 second for a
client-server protocol to be initialized in the background. Once the
Model
has been created, the client and server are running
and repeatedly calling the fit()
method will be more
efficient (but still slower than fitting data with the 64-bit DLL in 64-bit Python,
or the 32-bit DLL in 32-bit Python).
Pseudocode is shown below that demonstrates the best way to apply fits if loading the 32-bit DLL in 64-bit Python. See A Model as a Context Manager for more details about the use of the with statement:
# Don't do this. Don't create a new model to process each data file.
for data in data_files:
with LinearModel(dll='nlf32') as model:
result = model.fit(data.x, data.y)
# Do this instead. Create a model once and then fit each data file.
with LinearModel(dll='nlf32') as model:
for data in data_files:
result = model.fit(data.x, data.y)