On Mar 16, 2015, at 3:31 PM, Manfred Kröhnert <mkroehnert42@googlemail.com> wrote:Hi Sven,_______________________________________________On Mon, Mar 16, 2015 at 7:14 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote: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.thanks for your input.This will come in handy once the files get bigger.But the problem is not in reading the file.Even when I use 'reader upToEnd' it is really fast and all following actions remain fluent.The problem I am facing is that any action I am performing _after_ drawing the graph takes several seconds.And I just noticed that switching from the Canvas to the Raw tab of the TRCanvas object makes the problem disappear.But switching to the Canvas tab itself takes several seconds (probably until the graph is rendered) and every action afterwards is getting delayed several seconds.The machine I am running this image on has 8 GB RAM and a 2.8 GHz Core i7 (mobile) processor if this information helps.Best,ManfredHTH,
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
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev