Page 2 of 2 FirstFirst 12
Results 41 to 73 of 73

Thread: instr Count

  1. #41
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    I can't do LCase$ to an array Besides doing LCase$ to data that might be even 10 MB or more... you get the picture. It is super slow. That is probably what InStr does in TextCompare and that's the reason it is so slow.

    Also, arrays must be passed ByRef. They can't be passed ByVal. ByRef is also faster, because there is no need to make a copy of the variable.


    And for the last words, doing binary comparison is super fast. Also... my current version of InBArr is almost as fast in TextCompare as it is in BinaryCompare. I've used a few tricks in the code to strip down unrequired calculations. Doing fast code means that the code must be long as well.
    Last edited by Merri; Jul 11th, 2005 at 06:09 AM.

  2. #42
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    InBArrBM at Planet Source Code

    This is a boosted version using the Boyer-Moore string searching algorithm. It doesn't work as fast in all cases, but it beats InStr very well under many circumtances. It is perfect for searching a lot of text with a longer keyword (suprisingly, the longer the keyword, the faster it searches [except if there is a lot of content like the keyword]). It doesn't need to make as much work as InStr which works with brute force logic.

    It isn't very hard to change it to count strings: just instead of exit function you count up and continue from where you were.


    Oh, and due to the nature of Boyer-Moore, there is a keyword optimization. It checks if the keyword has changed or not and if the settings have changed. I used a pretty weird approach, it is within a Do Loop which isn't actually a loop. I noticed that if I used Goto, the function slowed down for some reason.
    Last edited by Merri; Jul 15th, 2005 at 10:17 AM.

  3. #43

    Thread Starter
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772

    Re: instr Count

    Merri,

    I've tried checking the speed but I'm getting dodgy results

    If you get time check this out and see what results you get

    forgive me: The test cases have been put together in a rush so could definitely be better as well as presented better

    Cheers Al
    Attached Files Attached Files

  4. #44
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Just use the benchmark application I provided with InBArrBM, it does the same things without the bugs. It is much easier to add your own benchmarks

    You've atleast done an error with the Unicode part: VB strings already are Unicode, you don't need to remake them Unicode.

  5. #45

    Thread Starter
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772

    Re: instr Count

    Merri,

    Good stuff, I was about to post my results which were very unfavourable when run from the vbProject window, but when run from the compiled optimized exe it's very quick, good work! I've given you 5 stars on PSC!! I had to substitute your timer module for a timer class I've got as I keep getting a "calculation too complex" error with yours.

    I notice too that you've changed it to return the same position as InStr() which I think is a good thing

    Cheers Al
    Last edited by aconybeare; Jul 18th, 2005 at 04:22 AM.

  6. #46
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    There is only a code that changes InStr and InBArr values to be identical in all cases, so yuu can easily compare the results with eachother. I give you a few examples why InBArr gives a different position value:

    VB Code:
    1. Dim Temp As String
    2. ' set a string
    3. Temp = "abc"
    4. ' return the letter b if it exists in the string (we get an error if it doesn't)
    5. MsgBox Mid$(Temp, InStr(Temp, "b", 1))
    This code returns a string with text B in it.

    VB Code:
    1. Dim Temp() As Byte, PosValue As Long
    2. Dim Temp2() As Byte
    3. ' the array will be filled with UTF-16 character data (2 bytes/character)
    4. Temp = "abc"
    5. ' get position in array
    6. PosValue = InBArrBM(Temp, "b")
    7. ' reserve enough memory for another temporary array
    8. ReDim Temp2(1)
    9. ' fill the character into this array
    10. Temp2(0) = Temp(PosValue)
    11. Temp2(1) = Temp(PosValue + 1)
    12. ' convert the array to a string and display in a messagebox
    13. MsgBox CStr(Temp2)
    This isn't the best possible example, but it clearly shows why it doesn't give the same value than InStr. I didn't code a support for Option Base 1 because that would be a killer to the performance. Besides handling Option Base 0 (default) is much easier for a programmer as well once he gets used to it.

  7. #47
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: instr Count

    Why couldnt you use isntr to count the number of times a letter or word repeats? Seems the fastest to me..

  8. #48

    Thread Starter
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772

    Re: instr Count

    Hi,

    Yes you could, here is an example,
    http://www.xbeat.net/vbspeed/c_InStr...m#InStrCount01

    but I believe Merri's InBArrBM is faster

    Cheers Al

  9. #49
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    InStr is very slow especially when you use TextCompare. InStr doesn't even use any special technique to perform the search, it does it the hard brute force way (ie. checks every single byte). So that is why I coded something that is faster than InStr in many normal search situatations; and knowing InStr is most likely coded in ASM, it isn't a bad result. Though the main aim with my function was to provide a search function for byte arrays; beating InStr was a secondary goal.

    Btw, there are some people who have made ThunderVB, which allows adding ASM code into a VB6 app. Afaik they've made InStr replacement using Boyer-Moore, which should beat the native InStr in about every possible case.

  10. #50
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    I think myself and Penegate tied this up quite nicely with:http://www.vbforums.com/showthread.p...13#post2140013

    Let me know if you can improve upon what's going on here.
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  11. #51
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    The codes seem to lack Unicode support which gives invalid results when some special character languages are used. They also lack TextCompare support. Full codes would be nice so I didn't need to guess all the variables and API declarations used out-of-the-function.

  12. #52
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    Quote Originally Posted by Merri
    The codes seem to lack Unicode support which gives invalid results when some special character languages are used. They also lack TextCompare support. Full codes would be nice so I didn't need to guess all the variables and API declarations used out-of-the-function.
    Wrong thread?
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  13. #53
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Well, if you're planning to make a proper InStrCount, you need to have Unicode and TextCompare support. Both your and penagate's codes there seem to check for every other byte. penagate's code also crashes if the keyword is longer than one character.

    What is the real goal with the functions? They seem more like an ANSI character counters than functions looking for the number of strings within a string.

  14. #54
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    Take the i=i+2, and change it to i=i+1 then?
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  15. #55
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Hmm, so which code snippet I should actually be looking at? The one you directly linked to or the ones that were optimized? I started from the end of the thread.

  16. #56
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    VB Code:
    1. Public Function Sisic4(pStr As Long, pFind As Long, lenStr As Long, lenFind As Long) As Long
    2.  
    3.     Dim i As Long
    4.     Dim j As Long
    5.     Dim Flag As Long
    6.         CopyMemory BufStr(0), ByVal pStr, lenStr
    7.     CopyMemory BufFind(0), ByVal pFind, lenFind
    8.    
    9.     i = lenStr - 1
    10.    
    11.     If lenFind = 2 Then
    12.         Do Until i < lenFind
    13.             If BufStr(i - 1) = BufFind(0) Then
    14.                 Sisic4 = Sisic4 + 1
    15.             End If
    16.             i = i - 2
    17.         Loop
    18.     Else
    19.         Do Until i < lenFind
    20.             Flag = 0
    21.             j = lenFind - 1
    22.             Do Until j < 0
    23.                 If Not (BufStr(i - (lenFind - j)) = BufFind(j - 1)) Then
    24.                     Flag = -1
    25.                     Exit Do
    26.                 End If
    27.                 j = j - 2
    28.             Loop
    29.             If Flag = 0 Then
    30.                 Sisic4 = Sisic4 + 1
    31.             End If
    32.             i = i - 2
    33.         Loop
    34.     End If
    35. End Function

    Here's the stable version of my effort: penegate has some concerns over my final effort.

    You will need to define arrays outside of the function. If you change the '-2' to '-1' you should have a unicode compliant function.
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  17. #57
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    BTW: SISIC stands for "String In String Instance Count"
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  18. #58
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Your function didn't find "Now" as a keyword. It also fails with longer strings, because the byte array is always 512 bytes long... guess I'll increase the length manually. But that really isn't a great way to do it, imo.

  19. #59
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    It didn't find 'Now' ? Oops must be a bug.

    As for whether or not it's a good or bad way? Depends on how you write your code, I guess.

    I nearly always allocate 2k of heap for a process at application start up for stuff like this, so it makes no odds about the arrays (I copy the string to the heap and modify the pvData in the SAFEARRAY descriptor to the right place on the heap (as well as modifying other parts of the descriptor)

    In terms of efficiency, both peneage, and myself believe that this is probably the fastest way of doing the job.

    As you know speed nearly always compromises readibility
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  20. #60
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    I'm looking for a way doing it in Unicode and without a fixed size array. I'm doing pretty well atm I guess. Still some work to do though.

    It doesn't include the very first character into the search, that is why it fails.

  21. #61
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Here you have something that can take a very big string and still be fast (the ones by you and penagate keep getting slower and slower with bigger strings much more easily):

    Code:
    Option Explicit
    
    Private Declare Sub RtlMoveMemory Lib "ntdll.dll" (ByRef lpvDest As Any, ByRef lpvSrc As Any, ByVal cbLen As Long)
    'Private Declare Function VarPtrArray Lib "msvbvm50.dll" Alias "VarPtr" (Var() As Any) As Long
    Private Declare Function VarPtrArray Lib "msvbvm60.dll" Alias "VarPtr" (Var() As Any) As Long
    
    Private BufStrHeader(5) As Long
    Private BufFindHeader(5) As Long
    Private BufStr() As Integer
    Private BufFind() As Integer
    Private OldStr As Long
    Private OldFind As Long
    Public Sub SisicInitialize()
        BufStrHeader(0) = 1
        BufStrHeader(1) = 2
        BufStrHeader(4) = &H7FFFFFFF
        BufFindHeader(0) = 1
        BufFindHeader(1) = 2
        BufFindHeader(4) = &H7FFFFFFF
        OldStr = 0
        OldFind = 0
    End Sub
    Public Sub SisicTerminate()
        RtlMoveMemory ByVal VarPtrArray(BufStr), 0&, 4
        RtlMoveMemory ByVal VarPtrArray(BufFind), 0&, 4
    End Sub
    Public Function SisicM(pStr As Long, pFind As Long, lenStr As Long, lenFind As Long) As Long
        Dim i As Long
        Dim j As Long
        Dim k As Long
        Dim l As Long
        Dim Flag As Long
        
        If OldStr <> pStr Then
            BufStrHeader(3) = pStr
            RtlMoveMemory ByVal VarPtrArray(BufStr), VarPtr(BufStrHeader(0)), 4
            OldStr = pStr
        End If
        If OldFind <> pFind Then
            BufFindHeader(3) = pFind
            RtlMoveMemory ByVal VarPtrArray(BufFind), VarPtr(BufFindHeader(0)), 4
            OldFind = pFind
        End If
        
        If lenFind = 1 Then
            j = BufFind(0)
            For i = lenStr - 1 To 0 Step -1
                k = BufStr(i)
                If k = j Then SisicM = SisicM + 1
            Next i
        Else
            lenFind = lenFind - 1
            For i = lenStr - 1 To lenFind Step -1
                For j = lenFind To 0 Step -1
                    k = BufFind(j)
                    l = BufStr(i - (lenFind - j))
                    If Not (k = l) Then Flag = 1: Exit For
                Next j
                If Flag = 0 Then SisicM = SisicM + 1 Else Flag = 0
            Next i
        End If
    End Function

    Usage:

    VB Code:
    1. SisicInitialize
    2. Do
    3.     SisicM StrPtr(SEARCHSTRING), StrPtr(KEYWORD), Len(SEARCHSTRING), Len(KEYWORD)
    4. Loop
    5. SisicTerminate

    I haven't even done my main optimizations yet

  22. #62
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: instr Count

    Quote Originally Posted by |2eM!x
    Why couldnt you use isntr to count the number of times a letter or word repeats? Seems the fastest to me..
    god im so retarded..i meant use Split() function..damn i wasted a whole bunch of peopls time posting that.

    Why couldnt you use SPLIT() to count the number of times a letter or word repeats? Seems the fastest to me..

  23. #63
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    It isn't. Split isn't of the fastest functions around. Otherwise we would use it.

  24. #64
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: instr Count

    Okay, i just thought i was crazy smart and the only one to think of it. Nevermind then

  25. #65
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    Quote Originally Posted by Merri
    Here you have something that can take a very big string and still be fast (the ones by you and penagate keep getting slower and slower with bigger strings much more easily):

    Code:
    Option Explicit
    
    Private Declare Sub RtlMoveMemory Lib "ntdll.dll" (ByRef lpvDest As Any, ByRef lpvSrc As Any, ByVal cbLen As Long)
    'Private Declare Function VarPtrArray Lib "msvbvm50.dll" Alias "VarPtr" (Var() As Any) As Long
    Private Declare Function VarPtrArray Lib "msvbvm60.dll" Alias "VarPtr" (Var() As Any) As Long
    
    Private BufStrHeader(5) As Long
    Private BufFindHeader(5) As Long
    Private BufStr() As Integer
    Private BufFind() As Integer
    Private OldStr As Long
    Private OldFind As Long
    Public Sub SisicInitialize()
        BufStrHeader(0) = 1
        BufStrHeader(1) = 2
        BufStrHeader(4) = &H7FFFFFFF
        BufFindHeader(0) = 1
        BufFindHeader(1) = 2
        BufFindHeader(4) = &H7FFFFFFF
        OldStr = 0
        OldFind = 0
    End Sub
    Public Sub SisicTerminate()
        RtlMoveMemory ByVal VarPtrArray(BufStr), 0&, 4
        RtlMoveMemory ByVal VarPtrArray(BufFind), 0&, 4
    End Sub
    Public Function SisicM(pStr As Long, pFind As Long, lenStr As Long, lenFind As Long) As Long
        Dim i As Long
        Dim j As Long
        Dim k As Long
        Dim l As Long
        Dim Flag As Long
        
        If OldStr <> pStr Then
            BufStrHeader(3) = pStr
            RtlMoveMemory ByVal VarPtrArray(BufStr), VarPtr(BufStrHeader(0)), 4
            OldStr = pStr
        End If
        If OldFind <> pFind Then
            BufFindHeader(3) = pFind
            RtlMoveMemory ByVal VarPtrArray(BufFind), VarPtr(BufFindHeader(0)), 4
            OldFind = pFind
        End If
        
        If lenFind = 1 Then
            j = BufFind(0)
            For i = lenStr - 1 To 0 Step -1
                k = BufStr(i)
                If k = j Then SisicM = SisicM + 1
            Next i
        Else
            lenFind = lenFind - 1
            For i = lenStr - 1 To lenFind Step -1
                For j = lenFind To 0 Step -1
                    k = BufFind(j)
                    l = BufStr(i - (lenFind - j))
                    If Not (k = l) Then Flag = 1: Exit For
                Next j
                If Flag = 0 Then SisicM = SisicM + 1 Else Flag = 0
            Next i
        End If
    End Function

    Usage:

    VB Code:
    1. SisicInitialize
    2. Do
    3.     SisicM StrPtr(SEARCHSTRING), StrPtr(KEYWORD), Len(SEARCHSTRING), Len(KEYWORD)
    4. Loop
    5. SisicTerminate

    I haven't even done my main optimizations yet
    I think you'll find that your algorithm (which is almost identical to penegates, and mine) has just the same linear performance problem associated with longer strings.
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  26. #66
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    No, because your versions used CopyMemory to copy the whole string in memory from place A to B. This doesn't copy anything, it just moves an array starting point to point to the string and start working from there. If you think about it: is it first faster to copy 50 MB of string data to byte array or start directly handling the 50 MB?

    The algorithm itself was almost identical because I based it on your code. I just wanted to get it working. The next step would be to apply some nice optimizations and probably try adding Boyer-Moore and a support for TextCompare.

  27. #67
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Here are the "some nice optimizations". Enjoy.

    VB Code:
    1. Public Function SisicM(ByRef pStr As Long, ByRef pFind As Long, ByRef lenStr As Long, ByRef lenFind As Long) As Long
    2.     Dim lngA As Long, lngB As Long, lngC As Long
    3.     Dim intFind As Integer, intStr As Integer
    4.     Dim intFirst As Integer, intLast As Integer, lngCounter As Long, lngFlag As Long
    5.    
    6.     If OldStr <> pStr Then
    7.         BufStrHeader(3) = pStr
    8.         RtlMoveMemory ByVal VarPtrArray(BufStr), VarPtr(BufStrHeader(0)), 4
    9.         OldStr = pStr
    10.     End If
    11.     If OldFind <> pFind Then
    12.         BufFindHeader(3) = pFind
    13.         RtlMoveMemory ByVal VarPtrArray(BufFind), VarPtr(BufFindHeader(0)), 4
    14.         OldFind = pFind
    15.     End If
    16.    
    17.     If lenFind = 1 Then
    18.         intFirst = BufFind(0)
    19.         For lngA = lenStr - 1 To 0 Step -1
    20.             intStr = BufStr(lngA)
    21.             If intFirst = intStr Then lngCounter = lngCounter + 1
    22.         Next lngA
    23.     ElseIf lenFind = 2 Then
    24.         lenFind = 1
    25.         intFirst = BufFind(0)
    26.         intLast = BufFind(lenFind)
    27.         For lngA = lenStr - 1 To lenFind Step -1
    28.             intStr = BufStr(lngA)
    29.             If intLast = intStr Then
    30.                 intStr = BufStr(lngA - lenFind)
    31.                 If intFirst = intStr Then lngCounter = lngCounter + 1: lngA = lngA - lenFind
    32.             End If
    33.         Next lngA
    34.     Else
    35.         lenFind = lenFind - 1
    36.         intFirst = BufFind(0)
    37.         intLast = BufFind(lenFind)
    38.         For lngA = lenStr - 1 To lenFind Step -1
    39.             intStr = BufStr(lngA)
    40.             If intLast = intStr Then
    41.                 intStr = BufStr(lngA - lenFind)
    42.                 If intFirst = intStr Then
    43.                     lngC = lngA - 1
    44.                     For lngB = lenFind - 1 To 1 Step -1
    45.                         intFind = BufFind(lngB)
    46.                         intStr = BufStr(lngC)
    47.                         If Not (intFind = intStr) Then lngFlag = 1: Exit For
    48.                         lngC = lngC - 1
    49.                     Next lngB
    50.                     If lngFlag = 1 Then lngFlag = 0 Else lngCounter = lngCounter + 1: lngA = lngC
    51.                 End If
    52.             End If
    53.         Next lngA
    54.     End If
    55.     SisicM = lngCounter
    56. End Function

    Increases the speed remarkably with longer keywords. Didn't benchmark the difference, I only know it thanks to previous experience.


    Edit Updated variable names ... and a bug in counting two character long keywords.
    Last edited by Merri; Sep 15th, 2005 at 05:52 AM.

  28. #68
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    Hmmm. Pretty good stuff.
    I wouldn't use the Boyer-Moore algorithm, though. This is good for long strings - especially ones that have multiple searches applied.

    But for short ones which are only going to be searched once, then the creation of the distance table make the use of the algorithm inefficient.

    I suppose you could optimise further by having some sort of threshold where the Boyer-Moore would take over . . .

    (BTW - Nice touch avoiding the copy!)
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  29. #69
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Boyer-Moore for keywords longer than four or five characters might be ok. I also made quickly a InBArrBMCount (ridiculous function name, but oh well) and it gets faster in keywords of that length.

    Edit Oh... and Boyer-Moore for TextCompare is all good starting from three characters long keywords, I guess you can figure out why.
    Last edited by Merri; Sep 15th, 2005 at 08:39 AM.

  30. #70
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count

    All you need to do now is to slot the algorithm into a fully inherited object hierarchy and you too can lose all of that perfomance
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  31. #71
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    Object Orientated Inheritable ASM would rock!


    ... NOT!

  32. #72
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: instr Count



    I think someone's already tried that. If I recall correctly they called it MSIL . . .
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  33. #73
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: instr Count

    I love power failures. They have the magical touch of striking right before you have saved the last major changes you've done. Looks like I won't work out Boyer-Moore after all, doing it the second time today would be bothersome.

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
  •  



Click Here to Expand Forum to Full Width