bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Very slow ")save" on large workspace


From: Juergen Sauermann
Subject: Re: [Bug-apl] Very slow ")save" on large workspace
Date: Sat, 29 Oct 2016 19:54:49 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Hi Xtian,

thanks, fixed in SVN 801.

/// Jürgen


On 10/28/2016 04:13 AM, Christian Robert wrote:
      )clear
      ∇z←permute s
→((⍴,s)≤1)/ident
→((⍴s)>2)/recurse
z←s⍪1 2⍴⌽s ⋄ →0
ident: z←s ⋄ →0
recurse: z←(((⍴,z)÷⍴s),⍴s)⍴,z←{⍵,permute s~⍵}⍤0 s



      ⍝ Now do this

      v ← {⊂ 3 3 ⍴ ⍵}⍤1 permute ⍳9

      ⍴v
362880

      ⍝ "v" is a vector of all possibles permutations of 9 numbers arranged in a 3x3 matrix.

      ⍝ first 10 of the 362880 ones ...

      8⎕cr ¨ 10 ↑ v
 ┌→────┐  ┌→────┐  ┌→────┐  ┌→────┐  ┌→────┐  ┌→────┐  ┌→────┐  ┌→────┐  ┌→────┐  ┌→────┐
 ↓1 2 3│  ↓1 2 3│  ↓1 2 3│  ↓1 2 3│  ↓1 2 3│  ↓1 2 3│  ↓1 2 3│  ↓1 2 3│  ↓1 2 3│  ↓1 2 3│
 │4 5 6│  │4 5 6│  │4 5 6│  │4 5 6│  │4 5 6│  │4 5 6│  │4 5 7│  │4 5 7│  │4 5 7│  │4 5 7│
 │7 8 9│  │7 9 8│  │8 7 9│  │8 9 7│  │9 7 8│  │9 8 7│  │6 8 9│  │6 9 8│  │8 6 9│  │8 9 6│
 └─────┘  └─────┘  └─────┘  └─────┘  └─────┘  └─────┘  └─────┘  └─────┘  └─────┘  └─────┘

      ⍝ Now wallclock time how long it take to do a )save ...  (on my fast machine, took 139 seconds)

      ⍝ Remark that the )load will take something like only 1/100th or 2/100th of the )save time.


So, ")save" is far too slow on workspace with a large number of cells ...

Hoping you can improve it (as you did for Unique few weeks ago).

Xtian.


ps: ")dump" is very fast (~2 seconds) but reloading that .apl file take near infinite time.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]