Hi Manfred,
I can only help you with the NeoCSV & IO part. Here is how I would do it:
[
'manfred.csv' asFileReference writeStreamDo: [ :out |
(NeoCSVWriter on: (ZnBufferedWriteStream on: out)) in: [ :writer |
writer separator: $|; writeHeader: #(timestamp two three cpu); fieldWriter: #raw.
130000 timesRepeat: [
writer nextPut: { DateAndTime now asUnixTime. 999 atRandom. 999 atRandom. 999 atRandom } ] ] ].
] timeToRun. "0:00:00:01.917"
[
'manfred.csv' asFileReference readStreamDo: [ :in |
(NeoCSVReader on: (ZnBufferedReadStream on: in)) in: [ :reader |
reader separator: $|; readHeader.
reader addIntegerField; addIgnoredField; addIgnoredField; addIntegerField.
reader upToEnd ] ].
] timeToRun. "0:00:00:01.064"
I think that is acceptable for a 3Mb file.
HTH,
Sven
> _______________________________________________
> On 16 Mar 2015, at 17:48, Manfred Kröhnert <mkroehnert42@googlemail.com> wrote:
>
> Hi everyone,
>
> after having access to a machine running OS X 10.10.2 I started to give Moose 5.1 a try for some initial data analysis.
> I used Pharo Launcher (build #24) and downloaded the Moose image with buildnumber 304.
>
> The task is to read a CSV log file containing around 130000 entries, each containing a timestamp, a cpu usage number, and some other information.
> Everything works as expected, but the responsiveness of the image drops dramatically after executing the script in Playground with Cmd+Shift+g.
> After evaluating the script it takes several seconds to get a response to any action such as opening the world menu or switching tabs in the playground.
>
> Is this because I am doing something very inefficient (most probably) or does this problem occur more often?
> Here is the script I am using:
>
>
> cpuReader := NeoCSVReader on: (cpuFile readStream).
> cpuReader separator: $|.
> cpuHeader := cpuReader readHeader.
> cpuData := cpuReader upToEnd.
>
> g := RTGrapher new.
> g extent: 300@200.
>
> ds := RTDataSet new.
> ds points: (cpuData collect: [ :each |
> | timestamp cpuUsage |
> timestamp := (each at: 1) asNumber.
> cpuUsage := (each at: 4) asNumber.
> Array braceWith: timestamp with: cpuUsage]).
> ds x: #first.
> ds y: #second.
> ds connectColor: Color blue.
>
> g add: ds.
> g addDecorator: RTHorizontalTickLineDecorator new.
> g addDecorator: RTVerticalTickLineDecorator new.
> g build.
> g view canvas.
>
>
> I also noticed that the 'Meta' representation of an object looks very crammed since it does not use the full size available in the tab.
> Should issues like this be reported somewhere else?
>
> Thanks for taking a look at this,
> Manfred
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev