Use CREATE OBJECTS WITH OBJECT TYPE
In general, it is faster to use CREATE OBJECTS WITH OBJECT TYPE rather than CREATE OBJECT FROM MONADS. On my machine, it is between 7 and 10 times faster, depending on the backend.
One drawback of CREATE OBJECTS WITH OBJECT TYPE is that you can't get the object id_d back immediately. You would have to query the database (e.g., using SELECT OBJECTS HAVING MONADS IN) to find out the object id_ds of the newly created objects.
If your application requires complex interaction between objects, e.g., setting features based on other objects' id_ds, it may be easier (but certainly not faster) to use CREATE OBJECT FROM MONADS.
In order to speed up queries, one thing you can do is to issue a
$ manage_indices --drop databasename
command on the command-line before starting the program which populates the database. Then, once all creation has taken place, you can issue the command:
$ manage_indices --create databasename
in order to recreate the indices. See the manage_indices(1) manual page for more information.
You can also use the MQL statements DROP INDEXES and CREATE INDEXES. See the MQL User's Guide for more information.