dcsimg
Page 2 of 2 FirstFirst 12
Results 41 to 45 of 45

Thread: Running speed test-len/lenb/lstrlenW/CopyMemory/GetMem4

  1. #41

    Thread Starter
    Addicted Member
    Join Date
    Jan 2020
    Posts
    239

    Re: Running speed test-len/lenb/lstrlenW/CopyMemory/GetMem4

    Quote Originally Posted by Schmidt View Post
    To give an example...
    You could test your "theories and code for fast(er) String-Processing in VB6",
    by implementing something concrete, e.g. like a "fast Word-scanner/analyzer",
    with the task:
    - to use the "works of Shakespeare" as input (all in a single file '100.txt', download here: http://vbRichClient.com/Downloads/100.zip)
    - then go through (enumerate) each word of this file

    Olaf
    i upload a sample for test
    Decompression file(unzip),and rename 100.txt as ""TestData.txt""

    v6_LenStr_Test3.zip
    -------------
    AsmAbc UsedTime=4794.3771
    LenB UsedTime=5257.5644
    Len UsedTime=6159.0774
    AsmAbcLong UsedTime=6390.4502
    CopyMemory UsedTime=15053.8805
    lstrlenW UsedTime=23588.0598
    -----------
    AsmAbc UsedTime=1191.1928
    LenB UsedTime=1262.1042
    Len UsedTime=1308.7945
    AsmAbcLong UsedTime=1342.0196
    CopyMemory UsedTime=3628.8636
    lstrlenW UsedTime=5780.9561
    Last edited by xiaoyao; Yesterday at 06:26 AM.

  2. #42
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,574

    Re: Running speed test-len/lenb/lstrlenW/CopyMemory/GetMem4

    Quote Originally Posted by xiaoyao View Post
    i upload a sample for test
    Yes, you did - but you did not even understood the task.

    The task was not:
    - to split the FileContent into Lines
    - then measuring the string-length of each line

    Instead the taks was (on the given text-file):
    - to "parse unique words"
    - and to count their number of occurence each

    And yes, String (Word)-Len measuring is included in that task,
    but not "all of it".

    A fictive "User of your program" is not interested in different StrLen-methods.

    Instead what he's interested in is:
    - how "versatile" Shakespeare was with (different) words in his work (represented by the "unique wordcount")
    - and also how often he used e.g. the words "the" or "she", etc...

    Most Users here in this forum are capable to solve this task with about 20-30 lines of VB6-code
    (in a first, non-performance-optimized "straight version").

    If you cannot even do that much, who are you to give us "performance-tips"?

    Olaf

  3. #43

    Thread Starter
    Addicted Member
    Join Date
    Jan 2020
    Posts
    239

    Re: Running speed test-len/lenb/lstrlenW/CopyMemory/GetMem4

    Quote Originally Posted by baka View Post
    not sure what we need to know about calculation of a string length.
    usually what we need is string manipulation and array editing.
    when I work with very large text, its byte array not string at all, since string is slow.
    and working with byte array we already know the length.
    and if I use string I use safearrays. and we can get the length from .cElements1D

    and Im sure most of us are using len/lenb to know the length of a string.
    dim b() as byte
    We can bind the address of the memory-mapped fragment to a virtual byte variable pointer. Of course, you still need to know the length to construct a safe array. I usually use string mode to read or add characters to intercept parts.Now the problem is that multiple processes share memory-mapped data. Copying strings is unavoidable, so I want to use assembly to copy vb6 string data bstr (including the first 4 bytes in length).
    Please ignore the following:
    我们可以吧内存映射片段的地址绑定到一个虚拟的字节变量指针上面,当然前提你还是需要先知道长度才能构造安全数组。我平时主要用字符串方式读取或者字符相加,截取部分。
    现在问题是多个进程共享内存映射数据,吧字符串复制进去是无法避免的,所以想用汇编来复制vb6的字符串数据bstr (包含前面4个字节长度)

  4. #44

    Thread Starter
    Addicted Member
    Join Date
    Jan 2020
    Posts
    239

    Re: Running speed test-len/lenb/lstrlenW/CopyMemory/GetMem4

    How to implement the left, mid function assembly of vb6? 5 Chinese plus a number occupy 12 bytes, left (s, 3), is it to construct a new memory address, copy 6 bytes, and write 4 bytes in front = 6?
    The following is Chinese, please ignore:
    vb6的 left,mid 函数汇编如何实现?5个中文加一个数字占用12字节,left(s,3),是不是构造一个新的内存地址,复制6字节,再前面写入4字节长度=6?

  5. #45

    Thread Starter
    Addicted Member
    Join Date
    Jan 2020
    Posts
    239

    Re: Running speed test-len/lenb/lstrlenW/CopyMemory/GetMem4

    Quote Originally Posted by Schmidt View Post
    If you cannot even do that much, who are you to give us "performance-tips"?

    Olaf
    My goal is just to use memory-mapped string data. Using safe arrays can directly assign string values ​​instead of copying. Perhaps the internal assembly code still uses the principle of byte copying, so I now directly read the string length and data,

    Please ignore the following text:
    我的目标只是用来内存映射字符串数据,使用安全数组可以直接把字符串赋值方式代替复制,也许内部汇编代码还是用了字节复制的原理,所以我现在直接用汇编读取字符串长度和数据。

Page 2 of 2 FirstFirst 12

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width