Issue 5124 in pharo: Chronology Printing/Accessing Efficiency Improvements

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 5124 in pharo: Chronology Printing/Accessing Efficiency Improvements

pharo
Status: Accepted
Owner: ----
Labels: Milestone-1.4 Type-Feature

New issue 5124 by [hidden email]: Chronology Printing/Accessing  
Efficiency Improvements
http://code.google.com/p/pharo/issues/detail?id=5124

Various improvements to Date, Time and especially DataAndTime printing.
Inlined some accessors.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5124 in pharo: Chronology Printing/Accessing Efficiency Improvements

pharo

Comment #1 on issue 5124 by [hidden email]: Chronology  
Printing/Accessing Efficiency Improvements
http://code.google.com/p/pharo/issues/detail?id=5124

Name:  
SLICE-Issue-5124-Chronology-PrintingAccessing-Efficiency-Improvements-SvenVanCaekenberghe.1
Author: SvenVanCaekenberghe
Time: 20 December 2011, 11:17:03 pm
UUID: 4cd29b29-804d-445b-b4be-6e3fc69f1f80
Ancestors:
Dependencies: Kernel-SvenVanCaekenberghe.986

Various improvements to Date, Time and especially DataAndTime printing.
Inlined some accessors.

http://code.google.com/p/pharo/issues/detail?id=5124


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5124 in pharo: Chronology Printing/Accessing Efficiency Improvements

pharo

Comment #2 on issue 5124 by [hidden email]: Chronology  
Printing/Accessing Efficiency Improvements
http://code.google.com/p/pharo/issues/detail?id=5124

Some benchmark code:

times := (1 to: 365) collect: [ :each | Time fromSeconds: (60 * 60 * 24)  
atRandom ].
dates := ((Date newDay: 1 month: 1 year: 2011) to: (Date newDay: 1 month: 1  
year: 2012)) dates.
dateAndTimes := times with: dates collect: [ :time :date | DateAndTime  
date: date time: time ].

[ times collect: [ :each | each printString ] ] bench.
[ dates collect: [ :each | each printString ] ] bench.
[ dates collect: [ :each | each yyyymmdd ] ] bench.
[ dateAndTimes collect: [ :each | each printString ] ] bench.

[ String new: 8192 streamContents: [ :stream | times do: [ :each | each  
printOn: stream ] ] ] bench.
[ String new: 8192 streamContents: [ :stream | dates do: [ :each | each  
printOn: stream ] ] ] bench.
[ String new: 8192 streamContents: [ :stream | dates do: [ :each | each  
printOn: stream format: #(3 2 1 $- 1 1 2) ] ] ] bench.
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printOn: stream ] ] ] bench.
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printHMSOn: stream ] ] ] bench.
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printYMDOn: stream ] ] ] bench.




_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5124 in pharo: Chronology Printing/Accessing Efficiency Improvements

pharo
Updates:
        Status: FixReviewNeeded

Comment #3 on issue 5124 by [hidden email]: Chronology  
Printing/Accessing Efficiency Improvements
http://code.google.com/p/pharo/issues/detail?id=5124

BEFORE:

[ times collect: [ :each | each printString ] ] bench. '1,020 per second.'
[ dates collect: [ :each | each printString ] ] bench. '862 per second.'
[ dates collect: [ :each | each yyyymmdd ] ] bench. '833 per second.'
[ dateAndTimes collect: [ :each | each printString ] ] bench. '342 per  
second.'

[ String new: 8192 streamContents: [ :stream | times do: [ :each | each  
printOn: stream ] ] ] bench. '1,490 per second.'
[ String new: 8192 streamContents: [ :stream | dates do: [ :each | each  
printOn: stream ] ] ] bench. '1,210 per second.'
[ String new: 8192 streamContents: [ :stream | dates do: [ :each | each  
printOn: stream format: #(3 2 1 $- 1 1 2) ] ] ] bench. '1,040 per second.'
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printOn: stream ] ] ] bench. '392 per second.'
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printHMSOn: stream ] ] ] bench. '1,010 per second.'
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printYMDOn: stream ] ] ] bench. '998 per second.'

AFTER

[ times collect: [ :each | each printString ] ] bench. '1,210 per second.'
[ dates collect: [ :each | each printString ] ] bench. '866 per second.'
[ dates collect: [ :each | each yyyymmdd ] ] bench. '1,290 per second.'
[ dateAndTimes collect: [ :each | each printString ] ] bench. '593 per  
second.'

[ String new: 8192 streamContents: [ :stream | times do: [ :each | each  
printOn: stream ] ] ] bench. '1,940 per second.'
[ String new: 8192 streamContents: [ :stream | dates do: [ :each | each  
printOn: stream ] ] ] bench. '1,280 per second.'
[ String new: 8192 streamContents: [ :stream | dates do: [ :each | each  
printOn: stream format: #(3 2 1 $- 1 1 2) ] ] ] bench. '1,520 per second.'
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printOn: stream ] ] ] bench. '748 per second.'
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printHMSOn: stream ] ] ] bench. '2,350 per second.'
[ String new: 10240 streamContents: [ :stream | dateAndTimes do: [ :each |  
each printYMDOn: stream ] ] ] bench. '1,670 per second.'

Furthermore, now printing does no longer generate garbage like crazy.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5124 in pharo: Chronology Printing/Accessing Efficiency Improvements

pharo
Updates:
        Status: Closed

Comment #4 on issue 5124 by [hidden email]: Chronology  
Printing/Accessing Efficiency Improvements
http://code.google.com/p/pharo/issues/detail?id=5124

in 14265.
I used the example for a new chapter :)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker