PureBasic 6.40 alpha 3 is ready, surprise inside !
Re: PureBasic 6.40 alpha 2 is ready, surprise inside !
Len + String is alignment 16 byte . So String address is alignment 16 byte + offset 8
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: PureBasic 6.40 alpha 2 is ready, surprise inside !
Yes the string is unaligned.mk-soft wrote: Sat Jan 31, 2026 1:23 am Len + String is alignment 16 byte . So String address is alignment 16 byte + offset 8
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
2026-01-31: alpha 3 is available for Windows x64 ! A few more bugs has been fixed, and a new StringBuilder library has been added for very fast string concatenation ! Here is a small example:
Don't hesitate to test this version if you can as we believe it's ready for larger tests.
Code: Select all
a$ = "Hello, World !"
CreateStringBuilder(0, 64000)
For l = 1 To 2000
AppendStringBuilderString(0, a$)
Next
b$ = FinishStringBuilder(0)Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
I just compared the new StringBuilder library with the string builder here and with a$ = ReplaceString(Space(50), " ", "Hello World !") ; Len =13*50=650
Wow! It's really super fast, with PB_Any and the cache size. Well done
I just looked at what I'm currently using in my app for the code generation,
The only thing I'm missing is Right, which can be very useful, to do for ex:
Wouldn't it be better with AppendStringBuilder(A, a$) only rather than AppendStringBuilderString(A, a$)
Thanks for adding it
Wow! It's really super fast, with PB_Any and the cache size. Well done
Code: Select all
StringBuilder Large concat Size(1300000) 2 ms
ExString Large concat Size(1300000) 18 msI just looked at what I'm currently using in my app for the code generation,
The only thing I'm missing is Right, which can be very useful, to do for ex:
Code: Select all
If RightStringBuilder(0, 4) <> #CRLF$+#CRLF$
AppendStringBuilderString(0, #CRLF$)
EndIf
AppendStringBuilderString(0, a$)Wouldn't it be better with AppendStringBuilder(A, a$) only rather than AppendStringBuilderString(A, a$)
Thanks for adding it
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
More Result:
PureBasic 6.40 alpha 3 - C Backend (Windows - x64)
Feel the ..Pure.. Power
Sadly, I'm going to prepare a little funeral for my StringBuilder. It was really fun to do it. Sniff
Okay, we can prepare it together with HeX0R's StringBuilder Interface and mk-soft's FastString
Code: Select all
PB Way Large concat PB6.30 Size(1300000): 2025 ms
PB Way Large concat PB6.40a3 Size(1300000): 262 ms
ExString Large concat Size(1300000): 18 ms (cache 64000)
StringBuilder Large concat Size(1300000): 2 ms (cache 64000)Feel the ..Pure.. Power
Sadly, I'm going to prepare a little funeral for my StringBuilder. It was really fun to do it. Sniff
Okay, we can prepare it together with HeX0R's StringBuilder Interface and mk-soft's FastString
Last edited by ChrisR on Sat Jan 31, 2026 4:41 pm, edited 1 time in total.
-
threedslider
- Enthusiast

- Posts: 578
- Joined: Sat Feb 12, 2022 7:15 pm
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
Even more impressive with the last version of PB
Again thanks all to Fred, Team and users !
Again thanks all to Fred, Team and users !
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
About the right() command, you should be able to do it before adding it, no? What's the real use case ?
About the naming, I was thinking to add may be some additional command like AppendStringBuilderDouble/Integer for fast number concat, that's why I put String at the end
About the naming, I was thinking to add may be some additional command like AppendStringBuilderDouble/Integer for fast number concat, that's why I put String at the end
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
Shouldn't there be a limit on the length of function names? (Just kidding.)
Keep up the good work, and continue to surprise me.
Keep up the good work, and continue to surprise me.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
Thanks!
I still have heinous crash for this line in a 30k loc app.
wmi\mp$ = UCase(mpFileNamePath$)
I will need time to shrink snippet.
Compiler crash:
Is there a migration tutorial?
If it is a lot, shouldn't this be a major version change?
Like version method [Major-may-break-old-code].[Minor-backward-compatible-features].[Bug-fixes] ?
I still have heinous crash for this line in a 30k loc app.
wmi\mp$ = UCase(mpFileNamePath$)
I will need time to shrink snippet.
Compiler crash:
Code: Select all
[11:13:12] Waiting for executable to start...
[11:13:12] Executable type: Windows - x64 (64bit, Unicode, Thread)
[11:13:12] Executable started.
[11:13:19] [ERROR] my.pbi (Line: 4292)
[11:13:19] [ERROR] Invalid memory access. (write error at address 0)
[11:13:19] [ERROR] my.pbi (Line: 4292)
[11:13:19] [ERROR] Invalid memory access. (read error at address 5220935860488)
[11:13:19] [ERROR] my.pbi (Line: 4292)
[11:13:19] [ERROR] Invalid memory access. (read error at address 5220935860488)
[11:13:19] [ERROR] my.pbi (Line: 4292)
...REPEATING UNTIL...
[11:13:22] The Program was killed.
If it is a lot, shouldn't this be a major version change?
Like version method [Major-may-break-old-code].[Minor-backward-compatible-features].[Bug-fixes] ?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
Sure, but in my case, it's really easier (and faster) to do it this way by testing the double CRLF, otherwise I'll have to do some additional testing to find out what will be written next.Fred wrote: Sat Jan 31, 2026 4:46 pm About the right() command, you should be able to do it before adding it, no? What's the real use case ?
Since you must have the final address, it should be fairly easy PeekS(*FinalAddress - (Len * SizeOf(Character)), Len)
But I can understand, if you prefer to stay with a pure StringBuilder, in this case, is it possible to retrieve the initial and final addresses with something like: *mem = GetStringBuilderAdress(0, [#PB_StringBuilder_Last])?
Good, for AppendStringBuilderDouble/Integer
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
@skywalk
No crash with structure here...
Where does the variable "mpFileNamePath$" come from. If it comes from API, it must be corrected with PeekS.
No crash with structure here...
Where does the variable "mpFileNamePath$" come from. If it comes from API, it must be corrected with PeekS.
Code: Select all
Structure udtData
iVal.i
sVal$
EndStructure
Define MyData.udtData
Filename$ = #PB_Compiler_Home
MyData\sVal$ = UCase(Filename$)
Debug MyData\sVal$
/code]My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
Well, this is called at different times from different sources, basically the app path and subfolders are defined in some constants:
#MY_server$ = "C:\"
#MY_app_path$ = "mypath\"
etc.
Filename = #MY_server$ + #MY_app_path$ + "some-new-file-to-load.extension"
I will make a snippet, but this is basic stuff.
A new feature should not break basic code without a major version change.
#MY_server$ = "C:\"
#MY_app_path$ = "mypath\"
etc.
Filename = #MY_server$ + #MY_app_path$ + "some-new-file-to-load.extension"
I will make a snippet, but this is basic stuff.
A new feature should not break basic code without a major version change.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
-
Little John
- Addict

- Posts: 4842
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
Axolotl wrote: Sat Jan 31, 2026 5:18 pm Shouldn't there be a limit on the length of function names? (Just kidding.)
Re: PureBasic 6.40 alpha 1 is ready, surprise inside !
Freak, I agree with all this you've said, about this workaround that ChrisR and fryquez discussed. But I think that's more reason for a native "UpdateStringLength" or "ResetStringLength" command. Even if it's just doing a PeekS() internally! Then it could be optimized in the future, or string lib internals could be reworked, automatic benefits for the user with zero changes to the user's code...freak wrote: Thu Jan 29, 2026 9:52 pmThe problem is spreading this code as a "tip" around the forum, which will lead to people blindly using it thinking they are doing a clever optimization without understanding the details. And then if we do change something, we have to deal with the complaints again. And all that for an "optimization" that is not even worth that word.
...
...
... also I think it makes code cleaner than unexplained Var = PeekS(@Var) scattered around
Re: PureBasic 6.40 alpha 3 is ready, surprise inside !
Personally, I think it would be good to let us play with this prefix, but it would be better with an official guarantee in its integrity. Then, it's the developer's responsibility to know what they're doing
There is few points in its favor, in the last 2 post here
I apologize in advance if I shouldn't, but someone sent me this macro recently, the fastest.
But the debate should not be about speed, PeekS is fast enough.
There is few points in its favor, in the last 2 post here
I apologize in advance if I shouldn't, but someone sent me this macro recently, the fastest.
But the debate should not be about speed, PeekS is fast enough.
Code: Select all
CompilerIf #PB_Compiler_Version >= 640
Macro UpdateStringLength(String)
*string = @String : If *string : PokeI(*string - SizeOf(Integer), MemoryStringLength(*string)) : EndIf
EndMacro
CompilerElse
Macro UpdateStringLength(String)
;
EndMacro
CompilerEndIf
