... has been fixed, and a new StringBuilder library has been added for very fast string concatenation ! Here is a small example:
a$ = "Hello, World ... Ex:
a$ = UCase(b$ + c$)
The allocation is done when concatenating 'b$' + 'c$', then the UCase() function directly change the buffer ...
Search found 12 matches: Fast concatenating
Searched query: +Fast +concatenating
- Fri Jan 23, 2026 10:47 am
- Forum: Announcement
- Topic: PureBasic 6.40 beta 1 is ready, surprise inside !
- Replies: 153
- Views: 35855
- Tue Feb 14, 2023 2:30 pm
- Forum: Feature Requests and Wishlists
- Topic: Lack of "fast strings"
- Replies: 30
- Views: 5704
Re: Lack of "fast strings"
... completely mistaken, the really slow thing about string functions is concatenating strings.
Define myString.s
For Counter = 0 To 99
myString ... s()
For Counter = 0 To 99
AddElement(myList()) : myList() = "much faster"
Next
Now we just need a new command to 'merge' the LinkedList into ...
Define myString.s
For Counter = 0 To 99
myString ... s()
For Counter = 0 To 99
AddElement(myList()) : myList() = "much faster"
Next
Now we just need a new command to 'merge' the LinkedList into ...
- Thu Feb 02, 2023 7:38 am
- Forum: General Discussion
- Topic: Feature list (?)
- Replies: 18
- Views: 7477
Feature list (?)
... JoinL (wilbert)
Remove all duplicate lines
StringBetween (mk-soft)
FastString - Structured Memory String (mk-soft)
Fast concatenating (AZJIO)
TrimCharsToString (mk-soft)
IsNumeric (mk-soft)
IsLatin, IsDigital, IsHex, IsFloat (AZJIO)
RTrimChar, LTrimChar (AZJIO)
SplitListByWords ...
Remove all duplicate lines
StringBetween (mk-soft)
FastString - Structured Memory String (mk-soft)
Fast concatenating (AZJIO)
TrimCharsToString (mk-soft)
IsNumeric (mk-soft)
IsLatin, IsDigital, IsHex, IsFloat (AZJIO)
RTrimChar, LTrimChar (AZJIO)
SplitListByWords ...
- Sun Sep 18, 2022 11:42 pm
- Forum: Coding Questions
- Topic: Performance of string concatenation
- Replies: 4
- Views: 1394
Re: Performance of string concatenation
See an example of concatenating strings with CopyMemoryString()
https://www.purebasic.fr/english/viewtopic.php?p=566355#p566355
https://www.purebasic.fr ... to the list and then copied to a pre-allocated memory buffer.
Search " Fast concatenating " on the forum
https://www.purebasic.fr/english/viewtopic ...
https://www.purebasic.fr/english/viewtopic.php?p=566355#p566355
https://www.purebasic.fr ... to the list and then copied to a pre-allocated memory buffer.
Search " Fast concatenating " on the forum
https://www.purebasic.fr/english/viewtopic ...
- Mon Mar 20, 2017 12:35 pm
- Forum: Feature Requests and Wishlists
- Topic: Preallocate memory for Strings
- Replies: 6
- Views: 2804
Re: Preallocate memory for Strings
... Since 20 years now I always use this small trick to concatenate very fast without any tricks. Works on all platforms:
; test with no trick ... gets, the more time is needed for steps 1 and 2. Thus, working with smaller strings and concatenating the long ones not that often increases the speed!
; test with no trick ... gets, the more time is needed for steps 1 and 2. Thus, working with smaller strings and concatenating the long ones not that often increases the speed!
- Fri Mar 28, 2014 4:35 pm
- Forum: Feature Requests and Wishlists
- Topic: Fast string
- Replies: 67
- Views: 56997
Re: Fast string
Yes, but PureBasic is using HeapAlloc, not HeapReAlloc, while concatenating strings.
- Wed Nov 13, 2013 8:52 pm
- Forum: Coding Questions
- Topic: Packing bytes: a little help from my friends
- Replies: 69
- Views: 19591
Packing bytes: a little help from my friends
... 0010'
'0111'
'1111'
'01010'
'01101'
'11111'
'011011'
...[]
I'm just concatenating the strings like this:
codestream$ = RSet(Bin(CodeTable(ib),#PB ... as bitshifting, masking with binary AND OR XOR NOT etc., what's a good fast way to do this? ASM solutions are fine, but if you're going to reply with ...
'0111'
'1111'
'01010'
'01101'
'11111'
'011011'
...[]
I'm just concatenating the strings like this:
codestream$ = RSet(Bin(CodeTable(ib),#PB ... as bitshifting, masking with binary AND OR XOR NOT etc., what's a good fast way to do this? ASM solutions are fine, but if you're going to reply with ...
- Fri Jun 17, 2011 7:48 pm
- Forum: Coding Questions
- Topic: Fast string building
- Replies: 29
- Views: 6951
Re: Fast string building
... PB. :wink:
Side note:
VB6 native string concatenation(&) is actually faster than PB. But, CopyMemoryString() blows it away and is easy to use ... memlen + 1)
If *buf
*p = *buf ; Create tracking pointer for concatenating memory
If memlen <= MemorySize(*p) ; Verify enough memory created ...
Side note:
VB6 native string concatenation(&) is actually faster than PB. But, CopyMemoryString() blows it away and is easy to use ... memlen + 1)
If *buf
*p = *buf ; Create tracking pointer for concatenating memory
If memlen <= MemorySize(*p) ; Verify enough memory created ...
- Fri Jun 17, 2011 9:15 am
- Forum: Coding Questions
- Topic: Fast string building
- Replies: 29
- Views: 6951
Re: Fast string building
... strings of PB for handling this data.
Searching, cropping and concatenating string parts takes around 30% of the program execution time - so ... other stuff. I will have a look if Stringvariable.s=Space(Size) is as fast as StringPointer*=AllocateMemory(Size), that could help...
Thanks ...
Searching, cropping and concatenating string parts takes around 30% of the program execution time - so ... other stuff. I will have a look if Stringvariable.s=Space(Size) is as fast as StringPointer*=AllocateMemory(Size), that could help...
Thanks ...
- Wed Jun 15, 2011 9:05 pm
- Forum: Coding Questions
- Topic: Fast string building
- Replies: 29
- Views: 6951
Re: Fast string building
... PB. :wink:
Side note:
VB6 native string concatenation(&) is actually faster than PB. But, CopyMemoryString() blows it away and is easy to use ... memlen + 1)
If *buf
*p = *buf ; Create tracking pointer for concatenating memory
If memlen <= MemorySize(*p) ; Verify enough memory created ...
Side note:
VB6 native string concatenation(&) is actually faster than PB. But, CopyMemoryString() blows it away and is easy to use ... memlen + 1)
If *buf
*p = *buf ; Create tracking pointer for concatenating memory
If memlen <= MemorySize(*p) ; Verify enough memory created ...
- Wed Jun 15, 2011 10:18 am
- Forum: Coding Questions
- Topic: Fast string building
- Replies: 29
- Views: 6951
Re: Fast string building
Doesn't really matter since PB's built-in string functions will always be waaaay slower for tasks
that require concatenating a very large number of strings. The reason for this is that PB allocates memory
over and over again after every iteration to hold the new string. String Builder functions on the ...
that require concatenating a very large number of strings. The reason for this is that PB allocates memory
over and over again after every iteration to hold the new string. String Builder functions on the ...
- Thu Mar 09, 2006 7:53 pm
- Forum: Feature Requests and Wishlists
- Topic: Simple Classes and BSTR
- Replies: 1
- Views: 1710
Simple Classes and BSTR
... Allows for the efficient (very fast) building/concatenating of String variables.
'----------------------------------------------------------------------------------------------------------------------
' Usage:
' dim example
' set example = new StringBuilder ...
'----------------------------------------------------------------------------------------------------------------------
' Usage:
' dim example
' set example = new StringBuilder ...