Coder Social home page Coder Social logo

refreshable's Introduction

Autorelease

Refreshable Bintray License

Simpler wrapper around a value that changes over time

Contributing

For instructions on how to set up your local development environment, check out the CONTRIBUTING.md.

refreshable's People

Contributors

carterkozak avatar ferozco avatar iamdanfox avatar regan-koopmans avatar schlosna avatar svc-autorelease avatar svc-excavator-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

refreshable's Issues

N^2 behavior when mapping refreshable

What happened?

We've had a couple instances where we've called Refreshable.map() in a tight loop and it's caused serious problems. The main issues here are:

  • map() is a really innocuous sounding name. I map things all the time, why should I be worried about this?
  • map() is synchronized, creating a potential bottleneck
  • map() copies and for-each's on a data structure every fixed number of invocations. This data structure is also added to on each map(), so the runtime of this is N^2
  • N^2 plus mutex equals walking off a cliff very easily

What did you want to happen?

3 possible improvements:

  1. delete/deprecate the map() function and direct people to just use subscribe or turn the refreshable into a supplier, or rename the map() function to indicate its heftiness
  2. Amortize the N^2 behavior down to linear or move it to be asynchronous somehow
  3. Use less heavy-weight concurrency than synchronized/mutex (some form of read-write or non-blocking concurrency)

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.