Someone with a clue answering my original question of whether the encoding when saving to file is wrong or not :)
Alternatively someone with VM knowledge looking into why the nextPut primitive is broken... And no, it's not just that the stream hasn't been placed in cache yet or that collection is full, placing a counter in nextPut and printing: |string ws| Smalltalk at: #NextPutPrimitiveFails put: 0. string := String new: 500000. ws := string writeStream. 500000 timesRepeat: [ws nextPut: $a]. NextPutPrimitiveFails. 500000 ) Cheers, Henry Stéphane Ducasse skrev: > so what would be the next step :) > > Stef > > On Oct 13, 2009, at 3:17 PM, Henrik Johansen wrote: > > >> Mariano Martinez Peck skrev: >> >>> WOW!!! I run it here in a Windows XP 1GB RAM and these are the >>> results: >>> >>> str storeOn: (FileStream newFileNamed: 'test22.txt'). >>> Time millisecondsToRun: [|fs| >>> fs := FileStream oldFileNamed: 'test22.txt'. >>> 50000 timesRepeat: [str storeOn: fs]. >>> fs close]. 84022 >>> >>> str storeOn2: (FileStream newFileNamed: 'test2.txt'). >>> Time millisecondsToRun: [|fs| >>> fs := FileStream oldFileNamed: 'test2.txt'. >>> 50000 timesRepeat: [str storeOn2: fs]. >>> fs close]. 4990 >>> >>> BIG DIFFERENCE >>> >>> >> Yeah, writing one char at a time (plus, when doing that, the broken >> nextPut: primitive) isn't exactly performant :P >> Btw, it works fine for Widestrings too when using storeOn: internally >> (in printString f.ex.), but not when writing them to file. :/ >> Plus, as I indicated, behaviour from storeOn: is not 100% preserved >> (different encoding used for ø), as I noted in the original post. >> >> Cheers, >> Henry >> >> _______________________________________________ >> Pharo-project mailing list >> [email protected] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
