Should I create a recordset first or just insert data?
I am using a web service using standalone VBScript.
The web service returns me a list of jobs that I need to scroll through and add to the SQL database.
I can either
- Launching through a nodelist, reading data and executing an SQL insert in a loop.
or - Start the nodelayer by creating a recordset, then walk through the recordset into which the SQL inserts are inserted.
Option 1 has speed on its side, but option 2 just seems ... somehow cleaner.
a source to share
One computer scientist named Donald Knuth once said:
Premature optimization is the root of all evil (or at least most of them) in programming.
You receive the response from the web service as an HTTP stream, and unless you do something special, your code won't take control until the entire response has been received. So storing it in an intermediate recordset will not win at any time. However, it won't be a big bill.
So go, whatever you are sure you can code without errors.
a source to share
Option 2 loads faster, option 1 is encoded faster. Do you want to take the time to make it fantastic and fast, or just bust it up and work?
Set it in your own function to be island and if you need speed later this is a simple refactor. Then you can move on to coding other things. Write it down correctly, optimize it later.
a source to share