Confirmed. Great !

   ts=: 6!:2 , 7!:2@]
   v=.v?v=.10000000
   #v
10000000
   10 {. v
5890540 3044422 4300710 5970936 7393626 1716018 5963044 1177509 5150028 3714108
   ts'([:-[:-[:-[:-]) v'
0.119559 1.3422e8
   ts'(-@:-@:-@:-@:]) v'
0.120559 1.3422e8
   ts'(-@:(-@:(-@:(-@:])))) v'
0.121043 1.3422e8
   ts' (-@-@-@-@]) v'
1.62424 1.3422e8

Cheers,
Erling

On 2017-09-29 17:14, Henry Rich wrote:
Running J8.06 64-bit, I find that your first 3 cases all use 1.3e8 bytes (which is the size of v).

Version 8.05 and later does much less copying of data than previous versions.

Henry Rich

On 9/29/2017 10:41 AM, Erling Hellenäs wrote:
Hi all !

Hopefully better examples this time.

   v=.v?v=.10000000
   #v
10000000
   10 {. v
9257364 5642952 2724566 7608992 7025081 5624810 5911207 1606397 5366536 5408278

As we can see here, there is a space penalty for using @: compared to [: f ]. This space penalty is removed with proper use of brackets. There is a space advantage and a serious time penalty for using @ instead.
   ts'([:-[:-[:-[:-]) v'
0.236697 2.68438e8
   ts'(-@:-@:-@:-@:]) v'
0.236098 5.36874e8
   ts'(-@:(-@:(-@:(-@:])))) v'
0.245187 2.68439e8
   ts' (-@-@-@-@]) v'
6.38008 1.34222e8

Cheers,
Erling Hellenäs



On 2017-09-29 16:01, Erling Hellenäs wrote:
Sorry, these were stupid examples. I'll come back. /Erling

On 2017-09-29 15:53, Erling Hellenäs wrote:
Hi all!

From these simple examples it does not seem to be any difference in time and space requirements between the [:+] syntax and the +@:] syntax. Not even if we insert more brackets.

     ts'(i.v) ([:+[:+[:+[:+]) i.v=.1000000'

0.00936323 1.67808e7

ts'(i.v) (+@:+@:+@:+@:]) i.v=.1000000'

0.00935086 1.67808e7

ts'(i.v) (+@:(+@:(+@:(+@:])))) i.v=.1000000'

0.00925313 1.67811e7


As we can see using @ instead of @: has a heavy penalty in both time and space  requirements.


ts'(i.v) (+@+@+@+@]) i.v=.1000000'

0.341589 1.69553e8


Cheers,

Erling


On 2017-09-29 05:31, Henry Rich wrote:
It seems a bit much to ask Raul to track down a recent email thread.

No, @: does not create a namespace.  Only explicit entities have a namespace.

Henry Rich

On 9/28/2017 11:19 PM, Erling Hellenäs wrote:
On 2017-09-29 04:59, Raul Miller wrote:
I do not know of any definition of "namespace" such that @: creates a namespace.

Why do you think that @: creates a namespace?

Thanks,

As I said there was a discussion about this in a long thread recently. Maybe you can find it? This is from what I remember of this thread, it's not from my  own investigations.

/Erling

---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm


---
This email has been checked for viruses by AVG.
http://www.avg.com

---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to