sumim #2288(2007/08/17 15:53 GMT) [ Smalltalk ] Rating0/0=0.00
rST をインストールした Squeak Smalltalk で。 10000 回はきつかったので 1000 回で計測。約 20 秒。 1.0Ghz PowerPC(サーバ), 1.5Ghz VIA C7M(クライアント); WiFi 11Mbps 経由
see: rST - Remote Smalltalk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
"サーバ側定義" Object subclass: #Doukaku Doukaku class >> pricestring: priceInt discount: discInt | result data | result := (priceInt * (100 - discInt) / 100) asInteger. data := {result. priceInt. discInt} collect: [:int | int asStringWithCommas]. ^'販売価格 {1}円 (定価{2}円から{3}%引き)' format: data "サーバ側スクリプト" RSTBroker startOnPort: 9999. RSTBroker export: Doukaku named: 'doukaku' "クライアント側スクリプト" | doukaku timeToRun result | doukaku := 'doukaku@xx.xx.xx.xx:9999' asLocalObject. timeToRun := [1000 timesRepeat: [ result := doukaku pricestring: 20000 discount: 20] ] timeToRun. ^{result. timeToRun} "=> #('販売価格 16,000円 (定価20,000円から20%引き)' 19677) "
Rating0/0=0.00-0+
[ reply ]
sumim
#2288()
[
Smalltalk
]
Rating0/0=0.00
see: rST - Remote Smalltalk
"サーバ側定義" Object subclass: #Doukaku Doukaku class >> pricestring: priceInt discount: discInt | result data | result := (priceInt * (100 - discInt) / 100) asInteger. data := {result. priceInt. discInt} collect: [:int | int asStringWithCommas]. ^'販売価格 {1}円 (定価{2}円から{3}%引き)' format: data "サーバ側スクリプト" RSTBroker startOnPort: 9999. RSTBroker export: Doukaku named: 'doukaku' "クライアント側スクリプト" | doukaku timeToRun result | doukaku := 'doukaku@xx.xx.xx.xx:9999' asLocalObject. timeToRun := [1000 timesRepeat: [ result := doukaku pricestring: 20000 discount: 20] ] timeToRun. ^{result. timeToRun} "=> #('販売価格 16,000円 (定価20,000円から20%引き)' 19677) "Rating0/0=0.00-0+
[ reply ]