Which is faster: columns of words or item delimited?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Which is faster: columns of words or item delimited?

Post by gyroscope » Wed Oct 21, 2009 1:03 pm

I have (or will have) approx. 12 fields with lists of words in them. The maximum amount of words in any one field would be in the region of 1000 words.

If I wish to find which field a word is in, would it be executed quicker if each word was on its own line as a list in each field, or delimited with commas? Or would the difference in speed be negligible and not worth worrying about, does anyone know please?

:)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Oct 21, 2009 1:59 pm

Dear gyroscope,

1000 words isn't much. Don't worry about speed.

Moreover, it doesn't matter which of the following lines you execute, they are most probably equally quick:

if "foo" is among the words of fld x then
if "foo" is among the items of fld x then
if "foo" is among the lines of fld x then

Are you currently having any speed issues?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Wed Oct 21, 2009 2:29 pm

Gyroscope,
I prefer lines, one word per line. It is just that I find that easier to maintain then an item list. And you can easily do a filter command.
I have uploaded a very rough example of a type ahead or progressive search type of stack to the old Rev 3.0 and below RevOnlne.

When you type into a field with each char there is a lookup in a list (1500 words, actually from the Rev dictionary 3.5) and you get the hits and partial hits.
I think this is pretty close to what you are up to. You might have a look at it.

username berndniggemann, name of stack progressiveSearch.

regards
Bernd
beware: it is not cleaned up, just bare, bare bones.

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Wed Oct 21, 2009 2:47 pm

Thank you for your speedy reply and info, Mark.
Are you currently having any speed issues?
No but my major project will be fairly complex at the end, with finding words in lists just the beginning. I reasoned that every process from input to output will soon build up speed-wise, so thought that I'd get the optimum performance for each process.

:)

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Wed Oct 21, 2009 2:58 pm

Hey Bernd, I must have been typing my reply to Mark when you replied, apologies there!
I prefer lines, one word per line. It is just that I find that easier to maintain then an item list.
Luckily I have my completed lists as one word per line, and as Mark pointed out there is no speed loss, and as you've pointed out it's easier to maintain, so I'll certainly stick with that way.
I have uploaded a very rough example of a type ahead or progressive search type of stack to the old Rev 3.0 and below RevOnlne.
Thank you very much, I'll download that now. It's sounding as if it will be very useful.

:)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld » Wed Oct 21, 2009 4:35 pm

I just added a new entry at the revJournal blog on benchmarking that may be helpful:
http://revjournal.com/blog.irv?pid=1256139270.452508
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Thu Oct 22, 2009 12:57 am

That's going to be very useful also, thank you Richard.

:)

Post Reply