diff -r 1563dce3c5b4 -r 9ccc84deaea0 compiler/benchmarks/PPCBenchmark.st --- a/compiler/benchmarks/PPCBenchmark.st Tue Aug 18 13:09:42 2015 +0100 +++ b/compiler/benchmarks/PPCBenchmark.st Tue Aug 18 16:57:08 2015 +0100 @@ -35,18 +35,27 @@ " ! -run: selector - | benchmarkSuiteClass | +run: selectorOrSelectors + | benchmarkSuiteClass benchmarkSuite | benchmarkSuiteClass := Smalltalk at: #BenchmarkSuite. benchmarkSuiteClass isNil ifTrue:[ self error: 'CalipeL is not loaded.' ]. - ^ (benchmarkSuiteClass class:self selector: selector ) run - + selectorOrSelectors isSymbol ifTrue:[ + benchmarkSuite := (benchmarkSuiteClass class:self selector: selectorOrSelectors ) run + ] ifFalse:[ + benchmarkSuite := benchmarkSuiteClass new. + selectorOrSelectors do:[:each | + benchmarkSuite addBenchmark: (BenchmarkInstance class: self selector: each) + ]. + ]. + ^ benchmarkSuite run " PPCBenchmark run: #benchmarkRBParserC " + + "Modified: / 18-08-2015 / 16:34:12 / Jan Vrany " ! spy: benchmark @@ -359,6 +368,40 @@ ! +benchmarkLRPParserC + + + + 1000 timesRepeat:[ + input do: [ :source | parser parse: source withContext: context ] + ] + + "Created: / 18-08-2015 / 16:27:27 / Jan Vrany " +! + +benchmarkLRPParserCompiledC + + + + + 1000 timesRepeat:[ + input do: [ :source | parser parse: source withContext: context ] + ] + + "Created: / 18-08-2015 / 16:26:49 / Jan Vrany " +! + +benchmarkLRPParser_johanfabry_39C + + + + 1000 timesRepeat:[ + input do: [ :source | parser parse: source withContext: context ] + ] + + "Created: / 18-08-2015 / 16:49:01 / Jan Vrany " +! + benchmarkRBParserC @@ -576,6 +619,37 @@ input := sources expressionSourcesBig. ! +setupLRPParser + + parser := PPCLRPParser new. + context := self context. + context initializeFor: parser. + input := PPCLRPSourcesResource current sources + + "Created: / 18-08-2015 / 16:34:57 / Jan Vrany " +! + +setupLRPParserCompiled + + configuration := PPCConfiguration universal. + parser := PPCLRPParser new compileWithConfiguration: configuration. + context := self context. + context initializeFor: parser. + input := PPCLRPSourcesResource current sources + + "Created: / 18-08-2015 / 16:35:04 / Jan Vrany " +! + +setupLRPParser_johanfabry_39 + + parser := PPCLRPParser_johanfabry_39 new. + context := self context. + context initializeFor: parser. + input := PPCLRPSourcesResource current sources + + "Created: / 18-08-2015 / 16:48:22 / Jan Vrany " +! + setupRBParser input := sources smalltalkSourcesBig. @@ -685,6 +759,17 @@ " ! +teardownLRPParserCompiled + parser class removeFromSystem. +" + size := input inject: 0 into: [:r :e | r + e size ]. + Transcript crShow: 'Compiled Grammar time: ', time asString. + Transcript crShow: 'Time per character: ', (time / size * 1000.0) asString, ' microseconds'. +" + + "Created: / 18-08-2015 / 16:36:11 / Jan Vrany " +! + teardownSmalltalkGrammarCompiled parser class removeFromSystem. "