]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/namespaces/namespaces.factor
Switch to https urls
[factor.git] / extra / benchmark / namespaces / namespaces.factor
1 ! Copyright (C) 2014 John Benediktsson
2 ! See https://factorcode.org/license.txt for BSD license
3
4 USING: kernel math namespaces ;
5
6 IN: benchmark.namespaces
7
8 SYMBOL: foo
9 SYMBOL: bar
10 SYMBOL: baz
11
12 : namespaces-benchmark ( -- )
13     200 [
14         123 foo [
15             200 [
16                 456 bar [
17                     200 [
18                         789 baz [
19                             foo get 123 assert=
20                             bar get 456 assert=
21                             baz get 789 assert=
22                         ] with-variable
23                     ] times
24                 ] with-variable
25             ] times
26         ] with-variable
27     ] times ;
28
29 MAIN: namespaces-benchmark