OMG text processing performance 6.7 - 9.5

Richard Gaskin ambassador at fourthworld.com
Tue Feb 4 17:12:40 EST 2020


Ralph DiMola wrote:
 > My initial timings was with an earlier v9 version. I will do some
 > timings on 9.5.1. In the meanwhile I wonder if doing a "delete char
 > 1 to n of myVar" is more expensive then "put char n to -1 of myVar
 > into myVar" as I do.

I had thought the exercise was to obtain a list of offsets for a given 
term within a larger string.

And that's something I need to do, a lot of actually, building indexes 
for a large collection of MBOX and similarly-structured files.

Here the delete method was far faster than working in-place with "start 
at", and the speed advantage grew as the file did.

Seemed counterintuitive when you first brought it up, but I can 
understand how Unicode can slow things down, esp. UTF-8 with its 
potentially-but-not-necessarily-varying character length.

The code I was using was similar to Alex' itemDel solution, but playing 
with all three together shows itemDel only slightly faster than delete, 
and both much faster than traversing in-place with "start at".

But now that others are seeing different results I'm keen to hear from 
Mark Waddingham on what factors can affect things so differently on 
different systems.

FWIW all my tests were done in LC 9.6dp2 on Ubuntu 18.04 LTS.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com





More information about the use-livecode mailing list