Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 21 06:40

    paulfalgout on master

    docs: Fix typos in Class Events… (compare)

  • Oct 21 06:40
    paulfalgout closed #3673
  • Oct 21 01:54
    coveralls commented #3673
  • Oct 21 01:52
    jhwohlgemuth opened #3673
  • Sep 16 01:39
    coveralls commented #3672
  • Sep 14 15:23

    paulfalgout on master

    docs: Fix typo (remove colon) (compare)

  • Sep 14 15:23
    paulfalgout closed #3672
  • Sep 13 23:09
    jhwohlgemuth edited #3672
  • Sep 13 23:08
    jhwohlgemuth commented #3672
  • Sep 13 23:06
    jhwohlgemuth synchronize #3672
  • Sep 12 15:18
    paulfalgout commented #3672
  • Sep 07 02:38
    coveralls commented #3672
  • Sep 07 02:36
    jhwohlgemuth opened #3672
  • Aug 21 15:35
    paulfalgout closed #3667
  • Aug 21 15:35
    paulfalgout commented #3667
  • Jul 10 21:38
    mainstreetmark commented #3631
  • Jun 18 11:39
    alexone077 commented #2200
  • Jun 18 11:39
    alexone077 commented #2200
  • Jun 06 13:18
    paulfalgout locked #3670
  • Jun 06 12:49
    thapaphon21731 commented #3670
Mars
@marcelisaac_twitter
How do I use a user js on Firefox?
Paul Falgout
@paulfalgout
?
dimtabu
@taburetkin
I had a few revelations today.
dimtabu
@taburetkin
the first one was realizing that iteration over object's keys is pretty expensive task. (no matter own or all).
the second one was realizing that iteration over linked list items will be pretty slower than just iterating over array elements
the third one was realizing that super-puper modern generator/iterator still stay expensive when you trying to do it over object keys and values.
the fourth was that array manipulation like inserting / splicing / iteration will be much more faster that any compositions of objects/maps/objects+arrays.
and all this lead me to very simple solution for working with events - just use simple flat array and thats all.
finally i made a library which is faster than bb on some cases and the same in others.
Paul Falgout
@paulfalgout
don't you need keys to know which index of the array, or how are you keeping track?
dimtabu
@taburetkin
i realy ended with only flat arrays.
splice(indexOf(item),1) - works very well
tested on 1000 elements array
Paul Falgout
@paulfalgout
wow indexOf is faster ?!?
dimtabu
@taburetkin
i have stats, let me show
Paul Falgout
@paulfalgout
any chance you're testing events near the top of the stack so indexOf is cheap?
dimtabu
@taburetkin
at first i tested all possible variant of working with data set
without any events library, just adding/removing/iterating over 1000 elements.
there were object literal, map, array, my special linked list (i was hoped it will beat all of them but it isnt)
and after this when i realized that array is just better i tried to remove backbone's style events from my lib
i mean this._events.eventName.callbacks -> this.allcalbacks and starts the test against this libs. and that was pretty cool
dimtabu
@taburetkin
image.png
this is 1000 elements and delete operation is against random elements somewhere
awful object iteration just eat all gains you can have from crud operations :-/
dimtabu
@taburetkin
for example, i have this test
        benchmark('bb', () => {
          beforeEach(() => {
            inst = bb;
            other = bbOther;
            inst.off();
            inst.on('a b c d e', cb);
            other.listenTo(inst, 'a d', () => { });
            other.listenTo(inst, 'e', () => { });
            other.listenTo(inst, 'f g', cb);
          });
          it('', () => {
            inst.off('a d e');
          });
        });
and the same for yaff
image.png
dimtabu
@taburetkin
so, to be honest. indexOf + splice is slower, as you can see. but it never goes alone, and if there will be some kind of iteration with removal, then you get benefits
and it will be interesting to test views manager in different ways.
we should think of some working case for test purposes and i will try to do something with it, if you wish
dimtabu
@taburetkin
also tested in the same setup removing the g event. it is the last added event in an array
bb: 999 992 op/sec,  0.001 avg ms
yaff: 800 031 op/sec,  0.001249 avg ms
dimtabu
@taburetkin
just take a look closer on views manager
i am not pretty familiar with it
but on the first look i saw this.
  • add to the end
  • add at specified index
  • clear all
    is there something else?
i mean how it used by cv
ah, + removing by index
Paul Falgout
@paulfalgout
yep.. beat me to it. I think that's it if I'm remembering correctly
dimtabu
@taburetkin
if i remember correctly _sortBy creates new instance of array
dimtabu
@taburetkin
what is swapChildViews ? who invokes this and in which case?
looks like orphan
Paul Falgout
@paulfalgout
you can switch the places of two children within a collectionview. it works? why does it look like an orphan?
dimtabu
@taburetkin
of course its not
correct me if i am wrong - its a public api but internally it not used
yeah not used within the library to do anything
dimtabu
@taburetkin
i just not find any use of it, only declaration thats why i thought its an orphan
but after that i goes to the docs and see its a something i don't know before ))
dimtabu
@taburetkin
i start to extend ChildManager and realized that its already used indexOf + splice
so )) i don't know what to improve here
also, i can say that adding a view to the manager is 100 000 ops / sec
setting an array ov views is 200 000 o/s
and removing by view is 300 000 o/s
Mars
@marcelisaac_twitter
Does anyone know how I can self-host with nextcloud?
dimtabu
@taburetkin
Paul, do you know how to debug backbone's tests? i just can't realize how to do that, is it possible at all?
Mars
@marcelisaac_twitter
Have you guys ever used cryptomator?
dimtabu
@taburetkin

what do you think about possibility to listen for dom events like this?

let el = document.createElement('div');
listener.listenToOnce(el, 'click', function(...args){ 
  console.log('CLICK', args, this);
});

i just checkit in codepen with my setInterop and you know what? it works :)

just published v2
John Michael Swartz
@graphographer
I'm wondering if anybody has noticed that the search function isn't working on marionettejs.com
I have a small team that needs to learn mn pretty quickly, and the docs are written such that a search feature is a necessity.
I'm happy to help out, should I just try to fix it and create a pull request?
Paul Falgout
@paulfalgout
I'm not sure why it hasn't gotten 4.1.2 though
ah I think because 4.1.0 technically had some features, but didn't actually update the doc files