[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: PUT-KEY-VALUE is sloooooooow

  • Thread starter Thread starter Rob Fitzpatrick
  • Start date Start date
Status
Not open for further replies.
R

Rob Fitzpatrick

Guest
I tried a little test to see what's going on in PUT-KEY-VALUE: define variable i as integer no-undo. define variable v-key as character no-undo. define variable v-val as character no-undo. etime( yes). do i = 1 to 1000: assign v-key = "foo" + string( i, "9999" ) v-val = "bar" + string( i, "9999" ). put-key-value section "mysection" key v-key value v-val. end. display etime. It took 4.71 sections to create 1000 key-value pairs. Each call to PUT-KEY-VALUE results in eight file operations: CreateFile LockFile QueryStandardInformationFile ReadFile WriteFile SetEndOfFileInformationFile UnlockFileSingle CloseFile Most of these operations are quick, ranging from about 30 microseconds to maybe a millisecond. But CloseFile is by far the most expensive, at 4.41 seconds, or 93.5% of the total elapsed time. So if you want to write a lot of keys all at once with high throughput, maybe James' idea of writing to the file with COPY-LOB would be better as you would only open and close the file once.

Continue reading...
 
Status
Not open for further replies.
Back
Top