Code Monkey home page Code Monkey logo

Comments (11)

bealex avatar bealex commented on July 22, 2024

Great case, thanks. I did not try to use the library with large sets, usually I'm dealing with hundred items at most and do not see this problem there.

Give me a couple of days, I'll try to think of something.

from awesometableanimationcalculator.

bealex avatar bealex commented on July 22, 2024

@mikeger I've questions regarding your case. How complex is your cell model equality check? How many cells and how many sections are there?

from awesometableanimationcalculator.

mikeger avatar mikeger commented on July 22, 2024

I am working on chat / communication app similar to Telegram / Skype. It's up to user, max I've seen was 1000 conversations.
The order of conversations is predefined by last message date. Conversations on our side can not be copied as they are NSManagedObjects, so on each reload I also have to "wrap" every conversation into containing object that is inherited from ACellModel.
Equality is checked by NSUUID conversation ID.

from awesometableanimationcalculator.

bealex avatar bealex commented on July 22, 2024

And how often do you invoke the calculator?

I'm profiling 100 000 (rather simple) cells right now and they are calculating about 30 seconds on iPod Touch 5th gen. That is very long (and I want to speed it up), but 1000 cells must sort in a fraction of a second.

from awesometableanimationcalculator.

mikeger avatar mikeger commented on July 22, 2024

Observed delay was around 300-600 ms on iPhone 5s, but it happens on every received message because every update could potentially bring some old chat up

from awesometableanimationcalculator.

bealex avatar bealex commented on July 22, 2024

I see.

Thanks for the information. Let's see what can be done here... :-)

from awesometableanimationcalculator.

bealex avatar bealex commented on July 22, 2024

One more question. Did you use updateItems to specify items you've added/updated/removed or setItems that updates whole list?

from awesometableanimationcalculator.

mikeger avatar mikeger commented on July 22, 2024

I've used setItems() because I don't know the updated items, if I would know the updated items then I would not need to use the library to calculate the difference :)

from awesometableanimationcalculator.

bealex avatar bealex commented on July 22, 2024

Usually you do know objects that were changed/added/removed, but you do not know where they must be placed in a list and do not know the table transformations you need to perform to get there.

When you use setItems, everything has to be checked. Of course it takes time :)

But anyway, I understand the exact problem now and will try to optimise it.

from awesometableanimationcalculator.

vani2 avatar vani2 commented on July 22, 2024

Hi! Look at this good implementation of Paul Heckel diffing algorithm by Instagram. I thinks it's related.

from awesometableanimationcalculator.

bealex avatar bealex commented on July 22, 2024

I need to look into it closely, but looks like there is not the common case. Does he takes into account possibility of several sections and cross-section items moving?

from awesometableanimationcalculator.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.