User Tag List

Results 1 to 4 of 4

Thread: Tokenizing strings goes too slow

  1. #1
    No Products Registered

    Join Date
    Mar 2008
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tokenizing strings goes too slow

    I have a string, let's say it looks like this (in reality the thing is a bit more complicated):
    "if{2+4 == 6}"
    Using several String Tokenizer Objects, I divide it several times in one loop, using respectively " ", then "{", then " " again, then "+". If the first division gives 3 elements, Tokenizer 2 divides element 0, then 1, then 2, and so on, and the same thing is done by other Tokenizers using delimiters I gave above. Despite being performed in a single loop, it goes really slowly. When the number of elements reaches 40, the 40th division with "+" is done after about 5 seconds. Is it my mistake, an MMF speed limit, or an extension issue?

    Don't ask me for the purpose of this scripting engine.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Tokenizing strings goes too slow

    You could try String Parser and see if its faster.
    .:::.Joshtek.:::.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Tokenizing strings goes too slow

    MFA example?

    You could also consider using Lua instead of creating your own scripting language.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Tokenizing strings goes too slow

    Joshtek: I've benchmarked String Parser 2 and Jamie's String Tokenizer, and Jam's extension is the faster one.

    Karzon: This has to be one of your mistakes. My latest level editor parses a whole bunch of polygon strings with up to 50 elements each, all together in a fraction of a second. It uses 2D tokenization with Jamie's string tokenizer. You aren't doing anything dodgy, such as re-tokenizing on every loop when you iterate through it's elements?

Similar Threads

  1. Slow Down?
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 3rd June 2011, 02:43 AM
  2. Scan Global Strings and Other strings
    By Ausomeman in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th May 2010, 04:01 PM
  3. Using Global Strings embedded in larger strings
    By Mudstick in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th May 2008, 01:23 PM
  4. Big Bug my ufo slow down and application slow down
    By DJ_Wild in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th October 2007, 04:58 PM
  5. Tokenizing Strings
    By SUBhuman in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 3rd July 2006, 09:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •