Help / Release / J 4.05 / /: Improved

From J Wiki
Jump to navigation Jump to search


>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release



/: Improved

initial writing: 2000-08-17
last updated: 2000-09-14


/: and \: are now faster on the following arguments:

  • floating point with singleton items
  • integer with singleton items with a large range of values
  • literal
  • boolean

Time comparisons are as follows:

   timer=: 6!:2
   timer '/:x' [ x=: 0.0001 * _5e8 + ? n $ 1e9   NB. floating point
   timer '/:x' [ x=:          _5e8 + ? n $ 1e9   NB. large-range integers
   timer '/:x' [ x=:                 ? n $ 2e5   NB. small-range integers
   timer '/:x' [ x=: a. {~ ? (1e5,c) $ #a.       NB. literal
   timer '/:x' [ x=:       ? (1e5,c) $ 2         NB. boolean

Floating Point

    n                  J 4.05                   J 4.04               
0.2e6 0.302012 0.456383
0.4e6 0.615973 1.033190
0.6e6 0.935240 1.640893
0.8e6 1.257217 2.318578
1.0e6 1.576179 2.973666
1.2e6 1.910105 3.671854
1.4e6 2.236779 4.397974
1.6e6 2.612417 5.180967
1.8e6 2.939107 5.904753
2.0e6 3.277890 6.630488


Integer

    n                  J 4.05                   J 4.04                small-range
0.2e6 0.149587 0.429219 0.095581
0.4e6 0.309308 0.911765 0.183275
0.6e6 0.472759 1.450299 0.274050
0.8e6 0.639314 2.051906 0.367092
1.0e6 0.804705 2.642700 0.456646
1.2e6 0.977645 3.255898 0.558076
1.4e6 1.154937 3.907931 0.650474
1.6e6 1.328249 4.592391 0.744653
1.8e6 1.566802 5.259390 0.843435
2.0e6 1.755446 5.919107 0.936690


Literal

 c                  J 4.05                   J 4.04               
 1 0.006581 0.006496
 2 0.023082 0.031320
 3 0.041029 0.051552
 4 0.061525 0.084591
 5 0.089871 0.120607
 6 0.120467 0.167932
 7 0.153918 0.214474
 8 0.192912 0.266387
 9 0.217187 0.309810
10 0.255006 0.366536
11 0.284199 0.413880
12 0.268811 0.273599


Boolean

 c                  J 4.05                   J 4.04               
 1 0.004078 0.004496
 2 0.011582 0.021969
 3 0.014719 0.036862
 4 0.016499 0.066874
 5 0.037756 0.097812
 6 0.042654 0.142226
 7 0.048336 0.179589
 8 0.049659 0.230784
 9 0.078442 0.271089
10 0.084332 0.321493
11 0.089564 0.369218
12 0.086398 0.361201




>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release