Author: Lars Wassermann <lars.wasserm...@gmail.com> Branch: Changeset: r347:36fa25ccafbe Date: 2013-04-29 13:50 +0200 http://bitbucket.org/pypy/lang-smalltalk/changeset/36fa25ccafbe/
Log: added filetree repository to the hg repository to enable smalltalk source control e.g. for benchmarks and formatting code diff --git a/.filetree b/.filetree new file mode 100644 --- /dev/null +++ b/.filetree @@ -0,0 +1,1 @@ +{ "packageExtension" : ".package" } diff --git a/SPy-Benchmarks.package/.filetree b/SPy-Benchmarks.package/.filetree new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/.filetree @@ -0,0 +1,4 @@ +{ + "noMethodMetaData" : true, + "separateMethodMetaAndSource" : false, + "useCypressPropertiesFile" : true } diff --git a/SPy-Benchmarks.package/Integer.extension/instance/runSPyBenchmarks.st b/SPy-Benchmarks.package/Integer.extension/instance/runSPyBenchmarks.st new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/Integer.extension/instance/runSPyBenchmarks.st @@ -0,0 +1,3 @@ +*SPy-Benchmarks +runSPyBenchmarks + ^ SPyRunner run \ No newline at end of file diff --git a/SPy-Benchmarks.package/Integer.extension/methodProperties.json b/SPy-Benchmarks.package/Integer.extension/methodProperties.json new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/Integer.extension/methodProperties.json @@ -0,0 +1,5 @@ +{ + "class" : { + }, + "instance" : { + "runSPyBenchmarks" : "lw 4/29/2013 13:20" } } diff --git a/SPy-Benchmarks.package/Integer.extension/properties.json b/SPy-Benchmarks.package/Integer.extension/properties.json new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/Integer.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "Integer" } diff --git a/SPy-Benchmarks.package/SPyRunner.class/README.md b/SPy-Benchmarks.package/SPyRunner.class/README.md new file mode 100644 diff --git a/SPy-Benchmarks.package/SPyRunner.class/class/format..st b/SPy-Benchmarks.package/SPyRunner.class/class/format..st new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/SPyRunner.class/class/format..st @@ -0,0 +1,14 @@ +benchmarks +format: result + "self run" + "runs all the benchmarks and creates a string of csv format with one column per benchmarks" + ^ String streamContents: + [ :aStream | | someSymbols | + someSymbols := result keys. + someSymbols + do: [ :aSymbol | aStream << aSymbol] + separatedBy: [ aStream << ';' ]. + aStream << String lf. + someSymbols + do: [ :aSymbol | aStream << (result at: aSymbol)] + separatedBy: [aStream << ';']] \ No newline at end of file diff --git a/SPy-Benchmarks.package/SPyRunner.class/class/run.st b/SPy-Benchmarks.package/SPyRunner.class/class/run.st new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/SPyRunner.class/class/run.st @@ -0,0 +1,9 @@ +benchmarks +run + "self run" + | result printString | + result := self runShootout. + printString := self format: result. + (Smalltalk vmParameterAt: 3) = 0 + ifTrue: [^printString] "SPy VM does not support stdout, yet" + ifFalse: [FileStream stdout nextPutAll: printString] \ No newline at end of file diff --git a/SPy-Benchmarks.package/SPyRunner.class/class/runShootout.st b/SPy-Benchmarks.package/SPyRunner.class/class/runShootout.st new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/SPyRunner.class/class/runShootout.st @@ -0,0 +1,15 @@ +benchmarks +runShootout + "self runShootout explore" + | stream times | + stream := (ByteString new: 10000) writeStream. + times := Dictionary new. + { [ShootoutTests nbody: 200000 "20000000" to: stream]. + [ShootoutTests binarytrees: 17 to: stream]. + [ShootoutTests chameneosredux: 2600000 to: stream]. + [ShootoutTests threadring: 100000000 to: stream] } do: + [:block | | benchmark t | + benchmark := (ShootoutTests selectorForSimpleBlock: block) copyUpTo: $:. + "Smalltalk garbageCollect." + times at: benchmark put: (t := Time millisecondsToRun: block)]. + ^times \ No newline at end of file diff --git a/SPy-Benchmarks.package/SPyRunner.class/methodProperties.json b/SPy-Benchmarks.package/SPyRunner.class/methodProperties.json new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/SPyRunner.class/methodProperties.json @@ -0,0 +1,7 @@ +{ + "class" : { + "format:" : "lw 4/29/2013 13:34", + "run" : "lw 4/29/2013 13:37", + "runShootout" : "lw 4/29/2013 13:17" }, + "instance" : { + } } diff --git a/SPy-Benchmarks.package/SPyRunner.class/properties.json b/SPy-Benchmarks.package/SPyRunner.class/properties.json new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/SPyRunner.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "SPy-Benchmarks", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "SPyRunner", + "pools" : [ + ], + "super" : "Object", + "type" : "normal" } diff --git a/SPy-Benchmarks.package/monticello.meta/categories.st b/SPy-Benchmarks.package/monticello.meta/categories.st new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/monticello.meta/categories.st @@ -0,0 +1,1 @@ +SystemOrganization addCategory: #'SPy-Benchmarks'! diff --git a/SPy-Benchmarks.package/monticello.meta/initializers.st b/SPy-Benchmarks.package/monticello.meta/initializers.st new file mode 100644 diff --git a/SPy-Benchmarks.package/monticello.meta/package b/SPy-Benchmarks.package/monticello.meta/package new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/monticello.meta/package @@ -0,0 +1,1 @@ +(name 'SPy-Benchmarks') \ No newline at end of file diff --git a/SPy-Benchmarks.package/monticello.meta/version b/SPy-Benchmarks.package/monticello.meta/version new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/monticello.meta/version @@ -0,0 +1,1 @@ +(name 'SPy-Benchmarks-lw.2' message 'second try for an initial commit with shootout tests' id 'e538d5dc-ff13-4753-a166-bb95af0c7e0b' date '29 April 2013' time '1:41:50.098 pm' author 'lw' ancestors ((name 'SPy-Benchmarks-lw.1' message 'initial commit with existing Shootout tests' id '67ba6a6a-5476-4dc0-892f-de76933491e8' date '29 April 2013' time '1:40:20.34 pm' author 'lw' ancestors () stepChildren ())) stepChildren ()) \ No newline at end of file diff --git a/SPy-Benchmarks.package/properties.json b/SPy-Benchmarks.package/properties.json new file mode 100644 --- /dev/null +++ b/SPy-Benchmarks.package/properties.json @@ -0,0 +1,2 @@ +{ + } _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit