• (Mostly off-topic (as the topic is the bizzare behavior you're seeing) - are those the strings you're saving? I assume it's something more substantive than that - if that's all it is, you could write a very small function to get the string from the index number, and dispense with the array entirely)

  • @DrAzzy, you are absolutely correct... the strings are way more substantial than algorithmic derivable values. The actual strings are shown in the code snippet below, which also includes the join-split and store operations in the ini() method. The 'KeyNMO'-thing was just a placeholder to imply that there are many of those - relatively short - strings. I did run out of memory when the strings in 2nd and 3rd block - which correlate - were less then half in count. The characters in the string are encoded values. The encoding is preliminary - but human readable and quick to interpret - and the encoded (unsigned) integer values are in ranges from 0 to 16, 32, and 96. I'm thinking of running them through a generator to compact them even more, and then use them as typed arrays. It would be interesting to elaborate on various implementations and the overall impact - not just in regard of the 'data and its structure', but also the dependent algorithms and their performance. For runtime - after initialization - the values are neededas individual addressable items. At one time I thought I could leave them as complete strings (joined) and access with .substr()... May be it will become possible after compacting them and then 'pay a bit more for it' while repeatedly extracting values. At a later time in the project I will be a more verbose about the strings' purposes.

    ;-)

    var o = 
    { o: "some singleton object"
    , bs: // borders "XY[Steps Right|steps left]...,..." filled polygons
    ["AACBC FADBD LaADA OADBD UACBC AECAC FEACcACcA IEGACcACc REAGACcAC UECAC"
    ,">HFDACe >LEadBa UHFDACe ULEadBa IKBAAcA NKBDACa JNEAE >NFDACe >REadBa"
    ,"FNADA RNADA UNFDACe UREadBa IQGACcACc ATCDACb FTDAD OTDAD UTCABcA ?WBAB"
    ,"FWACcAIAE IWGACcACc RWACeAIAC XWBAB >LAmMan LaNMano >RAKmAN L]NkALO"
    ]
    , ns: // nodes to segs - [<..K..[..k..}]  - "xyG(oodie(s))h...(oriz)v...(ertic)"
    ["@@.(U E@.)V K@.W N@.*X T@.+Y Y@.Z @D.,[ ED.-\\ HD..] KD./ ND.0 QD.1^ TD.2_ YD.`"
    ,"@G.3 EG.a HG.4 KG.b NG.5c QG. TG.6d YG. HJ.7e KJ.8 NJ.9 QJ.f @M-: EM.;g HM.h"
    ,"QM.<i TM.=j YM- HP.>k QP.l @S.?m ES.@n HS.A KS.o NS.Bp QS.C TS.Dq YS.r @V.E"
    ,"BV.s EV.Ft HV.Gu KV.H NV.I QV.Jv TV.w WV.Kx YV. @Y.Ly BY.M EY. HY.N KY.z NY.O{"
    ,"QY. TY.P WY.Q YY.| @\\.R K\\.S N\\.T Y\\."
    ]
    , ss: // segs - h[(..;..N..T] and v[V..a..s..|] - s(tart node)e(nd node)s(paces)
    ["<=D =>E ?@E @AD BCD CDB DEB EFB FGB GHB HID JKD LMB NOB PQD RSB STB TUB VWD"
    ,"WXB YZB Z[D \\]H ^_D _`B `aB bcB cdB deD fgA hiB ijB jkB klB lmB noB pqB qrB"
    ,"stB uvB wxB xyB z{J {|B |}J <BC =CC >EC ?FC @HC AIC BJB CKB DLB GOB HPB IQB"
    ,"KWE MSB NTB PzE RxB UyB W_E X\\B Y]B ZdE \\`B ]cB ^fB _hB ajB bkB dmB eoB"
    ,"gqB hrB isB lvB mwB nxB pzB t{B u|B y}B"
    ]
    , ini: function() {
        (this.bs = this.bs.join(" ").split(" ")).forEach(function(b){
          // do some stuff with the 'encoded' b-order information... 
         });
        (this.ns = this.ns.join(" ").split(" ")).forEach(function(n){
          // do stuff with the 'encoded' n-ode information...
         });
        (this.ss = this.ss.join(" ").split(" ")).forEach(function(s){
          // do stuff with the 'encoded' s-egment information...
         });
    };
    o.ini();
    
About

Avatar for DrAzzy @DrAzzy started