Working on Petit Delphi we found a strange implementation for asPetitStream:
Stream>asPetitStream
^ self contents asPetitStream
Further investigation showed that the basic peek was not fast enough for Petit Parser, as it is used a lot. So it implemented a "improved unchecked peek":
PPStream>peek
"An improved version of peek, that is slightly faster than the built in version."
^ self atEnd ifFalse: [ collection at: position + 1 ]
PPStream>uncheckedPeek
"An unchecked version of peek that throws an error if we try to peek over the end of the stream, even faster than #peek."
^ collection at: position + 1
But in my knowledge a basic peek should be fast. The real problem is the peek in the underlying peek:
PositionableStream>peek
"Answer what would be returned if the message next were sent to the
receiver. If the receiver is at the end, answer nil."
| nextObject |
self atEnd ifTrue: [^nil].
nextObject := self next.
position := position - 1.
^nextObject
That actually uses "self next". The least thing one should do is to cache the next object. But isn't there a primitive for peek in a file stream? Because al overriding peeks of PositionableStream have basically the same implementation: reading the next and restoring the state to before the peek (that is slow). So we would like to be able to remove PPStream without causing performance issues, as the only added method is the "improved peek".
Stephan and Diego
Hi!
Apparently ConfigurationOfMoose, the baseline 5.0 loads DSM using the following:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
spec project: 'DSM' with: [
spec
className: 'ConfigurationOfDSM';
file: 'ConfigurationOfDSM';
version: #development;
repository: 'http://www.smalltalkhub.com/mc/Moose/DSM/main' ].
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Shouldn't it be the #default version to load?
I've spent 2 hours because of this :-(
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi,
I reconfigured all official Moose Jenkins jobs to work with Pharo 3.0:
https://ci.inria.fr/moose/view/Moose%205.0/?
There still are a couple of issues with loading, but the builds do not look
that bad.
Cheers,
Doru
--
www.tudorgirba.com
"Every thing has its own flow"
Who is coming to FOSDEM2014 and is willing to help recording one or more sessions
at the Smalltalk devroom? Instructions and equipment are provided.
Thanks,
Stephan Eggermont