|
|
|||||||
This question deals with the use of string expressions in KiXtart v4.22 RC1. [ 28. October 2003, 20:47: Message edited by: sealeopard ] |
||||||||
|
|
|||||||
what does "string expression" mean exactly? |
||||||||
|
|
|||||||
"string expression" is copied directly from the KiXtart Manual. Thus, it means whatever the KiXtart Manual refers to. |
||||||||
|
|
|||||||
well, lookin at manual my answer was "right" but manual is not telling the truth there. the limit said there is really non-existent in many string expressions in kixtart. |
||||||||
|
|
|||||||
Jens, You should explain more or maybe post the questions or maybe you should let everyone see the results. As it is now, it seems that I have to vote in order to understand the issue. Without knowing the issue I don't want to participate because I might bias your results if I found out I couldn't contribute effectively. |
||||||||
|
|
|||||||
I at least know there must be 1 wrong answer according to the spreadness of the answers. |
||||||||
|
|
|||||||
Jack: I just like to know how long a string in Kixtart can be. And I'm curious whether any of the Kixtart coders actually know the correct answer. The question is: "How many characters can a string expression contain?" with regards to KiXtart v4.22 RC1 (the one I've tested it with) and is taken literally from the KiXtart Manual but reworded to form a question. The reason you have to vote first is to not generate a me-too result where everybody just votes for whatever the majority has voted for. And the majority has so far voted incorrectly! |
||||||||
|
|
|||||||
Jens, do you have the definitive answer? Is the answer from Ruud or from testing? |
||||||||
|
|
|||||||
The funny thing is: I don't know the correct anwser either. I have a suspicion but my test script has not yet reached the stage where it could provide the definite anwser. |
||||||||
|
|
|||||||
lol. well, according to your first reply about manual, I know what manual says. I also know that it isn't correct in all cases. although, some limitations apply. |
||||||||
|
|
|||||||
LOL2 first test results code: |
||||||||
|
|
|||||||
What's that? String length of negative 2 billion characters? |
||||||||
|
|
|||||||
Voted according the manual. Getting some doubts now though. Did some googling and stumbled onto this: http://www.dotnetforums.net/t76702.html I know its .NET but the basics seem correct to me. |
||||||||
|
|
|||||||
I know what the Manual says. I also know that some people have used code, e.g. in the KiXgolf competition, that contradicts the Manual. However, nobody has so far commented on this or even offered a new max string length. |
||||||||
|
|
|||||||
auch, hitting the int limit... Now using doubles. and counting... [ 29. October 2003, 22:51: Message edited by: MightyR1 ] |
||||||||
|
|
|||||||
pat, the lenght will raise like shit and what longer it gets, that slower kix will become. just like with large arrays. what comes to the limitation, it still holds at least with console output and some other stuff. |
||||||||
|
|
|||||||
code:My final guess: max_string_expression = 31920 charactersaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
||||||||
|
|
|||||||
lol, you fell for that. your quess has no base |
||||||||
|
|
|||||||
Tried this: code:And stopped getting a value out of $string1 at 30704.$string1 = "1" Patrick: How did you get your 31920? I guess I did sort of the same you did? Totally different values. Maybe this is not the way to find out max string length. |
||||||||
|
|
|||||||
I was playing with much larger strings and ran out of virtual memory. Kixtart never complained at all. code:$z="1234567890" [ 29. October 2003, 23:57: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
Not sure why people are guessing 32Kb because we all know it is much bigger than that ... I will toss my hat into the ring and guess the following: 2,147,483,648 |
||||||||
|
|
|||||||
That was my guess as well. Unfortunately I do not have the memory to test it. |
||||||||
|
|
|||||||
Was this your guess, or did you guess the number in the survey, which is one less. |
||||||||
|
|
|||||||
Details, details. The number in the survey was my guess. This is the output from my test program so far. The value is length of the string. 10240 20480 40960 81920 163840 327680 655360 1310720 2621440 5242880 10485760 20971520 41943040 83886080 167772160 |
||||||||
|
|
|||||||
Just teasing ... but other than Ruud, who knows the answer ... Jens, do you know the answer ? [edit] Oh yeah, do we get a KORG t-shirt if we're right ? [ 30. October 2003, 00:04: Message edited by: Shawn ] |
||||||||
|
|
|||||||
It is big but I do not have the memory or time at home to test it. Shawn's guess sounds reasonable but so do all the last 3 suggestions offered by jens. |
||||||||
|
|
|||||||
Last output... 335544320 Computer is crawling everything is being done in virtual memory... [ 30. October 2003, 00:14: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
I used this: code:wait for the beep, scroll a little upwards and see that after 31920 the string isn't displayed anymore...Break on Anyone know why?? [ 30. October 2003, 00:11: Message edited by: MightyR1 ] |
||||||||
|
|
|||||||
Same results here using Howard's code (first post 167772160). Stopped at this score cause the performace became realy bad. So Howard's code sort of proved that my code s#@$cks Kix32.exe using almost 300 MB of memory LOL [ 30. October 2003, 00:17: Message edited by: R2D2 ] |
||||||||
|
|
|||||||
STDOUT limitation? |
||||||||
|
|
|||||||
ok then no string output... sofar: 268435456 using code:Break on [ 30. October 2003, 00:24: Message edited by: MightyR1 ] |
||||||||
|
|
|||||||
one of the interesting problems - when one does hit the max string size - the script will probably crap with an expression too long error and you will never be able to capture that last accurate count. |
||||||||
|
|
|||||||
I put in a print to file every 1000th loop plus I checked the error code immediately after the extension figuring it might keep going but put out an error code. Into about a million, I got nothing. |
||||||||
|
|
|||||||
I have not been paying attention to my output Just looked and it returned lengths of 0... Will run again with get $x... Funny: |
||||||||
|
|
|||||||
I tried something like this but so far got nothing. code:redirectoutput("d:\kixgolf\kixstr.txt",1) |
||||||||
|
|
|||||||
String with length 268435456 added with same string gave me a new length of zero!!! This was on a P4, 2.8 GHz with 512 MB RAM Will now run on a P2, 400 Mhz with 192 MB RAM |
||||||||
|
|
|||||||
Next Q... is my previous result the max value of a string expression, or is it the max 'len' can handle??? How to test this??? |
||||||||
|
|
|||||||
Use SPLIT and ubound. Build a string of a million byte and add a delimiter. Then when Length goes to "0" split the string and check ubound. |
||||||||
|
|
|||||||
P2 results using code:gave meBreak on code:Looking at this, maybe the RAM determines the limit???Len = 2 Can't test more @home, will try at work if time allows |
||||||||
|
|
|||||||
I am not sure but I don't think there is any limit what so ever. I just ran this code code:and it seemed to effectively stop at$i=67,108,864. At this point I was using amost all my physical memmory & almost all my virtual memory & nothing was happening. When I tried opening other apps to see if I could find out what was happening the system became unstable & started shutting down apps & trying to reboot. at this point my best guess is it corrupted the virtual memory file because I keep getting a disk check error on reboot. Fortunately, my machine is dual boot & I was able to do a diskcheck from the 2nd version & rectify the problem.redirectoutput("d:\kixgolf\kixstr.txt",1) |
||||||||
|
|
|||||||
So many different scripts. Well if someone will post (and agree) on a valid script to really test this, then I'll run it on one of our 6BG RAM Quad 2.0GHz Xeon systems and see what I get. May take a couple days to get to this though. |
||||||||
|
|
|||||||
Interesting, isn't it? I'm currently running a test script on one of our work computers and it's at code:while adding 100,000 characters to the string on each iteration.String length = 133,300,000 = 130,175 kB = 127 MB Personally, I think that the limit might be the same number as the number of elements in an array (according tot he KiXtart v4.22 RC1 Manual) I was actually interested to see if anyone can fidn the solution before asking Ruud ;-) And based on the poll, only two people have voted for the number I suspect is the winning one. Most went for the incorrectly documented 32,000 character limit. |
||||||||
|
|
|||||||
The last script I posted was looping through using base 4. It succeeded in creating a string of 67,108,864 characters but it died trying to add 201,326,592 characters to the string. Unfortunately it did not die nicely. It seemed to just bring the OS to a halt. If it died nicely, I figured I would alter my script so it iteratively converged on the appropriate number by lowering the base & resetting the starting point to the last successful size. It would have been reasonably fast too but it required the loop to end with some kind of error condition. My machine at home only has 256M but I have it set so the virtual memory is 1GB. When the system hung most of this virtual memory was being used. |
||||||||
|
|
|||||||
Thanks Jack, Still waiting for a VALID script to use for testing on Server. |
||||||||
|
|
|||||||
NTDOC: Here's my test script code:cls [ 30. October 2003, 17:09: Message edited by: sealeopard ] |
||||||||
|
|
|||||||
k, I will start testing too. running on Pentium pro (200MHz) but with like 5,2G of mem. |
||||||||
|
|
|||||||
pat, how come your messenger is logged off? |
||||||||
|
|
|||||||
Had to go do a little fitness Therefore pc not turned on BTW I now get KiX errors telling me I'm 'Out of memory'... Jens, your script gave me: String Length Start = 0 String Length Final = -769,803,776 String Segment Length = 10,000,000 # Segments To Add = -77 Final String Length (0) = 0 = 0 MB Huh??? [ 31. October 2003, 07:27: Message edited by: MightyR1 ] |
||||||||
|
|
|||||||
pretty effective mem usage with nul-string! I got 35M mem usage with 21.000.000 long string... |
||||||||
|
|
|||||||
btw, noticed now how much I hate wintosh. anyway, going from physical mem to virtual (with w2k and 64MB it's pretty quickly) slows things down quite a lot. CPU is at 0-5% all the time and most of the time even HD's are quite silent (scsi-drives). started crawling at 20M and now the speed... well, there is none. not that HD is slow but windows makes the virtual management so slow that everything is sloow. if someone has a machine with 6-7G of ram, please shoot in. disable virtual mem and kick in with FAST results. |
||||||||
|
|
|||||||
Just another little wrinkle to add in as this is a mostly academic exercise. When catenating strings you will be creating copies (expressions on internal stacks, temporary copies for assigning). This means that unless you are very careful the limitation (memory/machine stability) will not be the string size, but the total size of the string(s) in the expression and the temporary copies. It also means that KiXtart may be able to handle different string sizes, depending on what you are doing with them. |
||||||||
|
|
|||||||
268.499.168 and counting... |
||||||||
|
|
|||||||
310,000,000 and counting ;-) Personally, I think the max string length is 2,147,483,647. |
||||||||
|
|
|||||||
Think not... adding 268435456 char string with 65536 char string gave "out of memory"... |
||||||||
|
|
|||||||
jens, making the poll now would make much more sofisticated results as most of us would know what you really asked... as a BTW... ps, pat, you still offline... |
||||||||
|
|
|||||||
Think I found the limit (at least according to Jens script). Script ran on HP/Compaq DL580-G3 Quad Xeon 2.0GHz CPU w/2MB L3 Cache Windows 2003 Enterprise Server 6GB RAM The script starts to rebuild at 448MB quote: [ 04. November 2003, 01:32: Message edited by: NTDOC ] |
||||||||
|
|
|||||||
Now, that would be an unexpected value. Still waiting for my script to finish on a slow P4-3.06 with 1GB RAM. |
||||||||
|
|
|||||||
with this task, the processor speed indeed is not a matter. only the physical ram amount does a difference. |
||||||||
|
|
|||||||
Not really. There's a lot of memory duplication going on, thus the RAM speed is also a factor as well as the HD speed in case the swapfile needs ot be used. Anyway, got it up to 450MB and will not try smaller increments at a baseline of 450MB. [ 04. November 2003, 16:07: Message edited by: sealeopard ] |
||||||||
|
|
|||||||
Interesting.. Here's a quick test - the string length doubles each iteration. It was run on a server with 2G of RAM. Obviously it's more than 32767 bytes! My script ran out of RAM (and 100% CPU cycles!) when going from 512Meg to 1Gig string length. I suppose I could trap this and grow the string incrementally after 512Meg, but hey - it's a scripting language! Why would I need more than 512Meg long strings?? (actually, I started increasing the string length by 32K right after 512M, and only got one segment of 32K beyond the 512M point..) Glenn code:It took about 2:36 to get to this point Here's the script: code: |
||||||||
|
|
|||||||
doing a golf with your script gives: code:Dim $L, $S |
||||||||
|
|
|||||||
What?? Post a question that has the incorrect answer in the manual? I thought that would be considered blasphemy with all the RTFM's I see around here. |
||||||||
|
|
|||||||
ROFLMAO You tell em CitrixMan |
||||||||
|
|
|||||||
it wasn't me! it was jens! |
||||||||
|
|
|||||||
Lessof-of-the-day: Don't believe everything you read! |
||||||||
|
|
|||||||
I was hoping that when Ruud stopped by this morning, that he would put us out of our string misery - instead, I think he and Jens just want to "string us along" a bit further (groan) ... Please, just shoot us and tell the answer -Shawn |
||||||||
|
|
|||||||
Does anyone have any more info to add to this ? I get the feeling that the practical (vs theoretical) string size limit is around 512mb ? |
||||||||
|
|
|||||||
It seems to be more around 480MB but I haven't had time to actually narrow it down to the byte |