Giter Club home page Giter Club logo

nodetiles-core's People

Contributors

bensheldon avatar daguar avatar eddietejeda avatar hampelm avatar mr0grog avatar prashtx avatar yuletide avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

nodetiles-core's Issues

Don't use Array.length in loop conditions

Per @mr0gorg's comment:

"In most engines, Array.length is calculated dynamically, so you should never use it in the loop's condition during performance-sensitive operations. Something like this is often much faster:

for (var i = 0, len = features.length; i < len; i++) {

This way, the length value is pre-computed and cached in len."

Lots of code duplication

The pipeline for filtered / non-filtered data is redundant; doubly so when you count the pipeline for UTF grids vs tiles vs tilejson.

Mongo performance ideas

Via @prashtx:

I was poking around for a way to get skip BSON parsing in the node mongodb driver. I found some interesting things on this page that could pertain to nodetiles/our performance investigations.
http://mongodb.github.io/node-mongodb-native/api-generated/cursor.html

In particular:

The raw flag might let us skip BSON parsing, but let's check the source to be sure. We can't use that data efficiently, but it'll help us better understand the "mongo time" piece of the puzzle.

The showDiskLoc flag might show us if we're doing a bunch of random reads for each request. On the mongolab shared plan, I'm pretty sure we're effectively using a magnetic hard drive underneath, as opposed to SSD.

The exhaust flag might avoid some round trips to issue the getMore requests.

If I get a chance to test these, I'll let you know.

Max zoom calculated incorrectly

in cartoRenderer around line 1275, max zoom needs an additional check to function correctly, like so:

      if (!maxZoom && minZoom && !(supportedZooms & (1 << i))) {
        console.log(minZoom, maxZoom);
        maxZoom = i - 1;
      }

Without if(!maxZoom ... , the maxZoom value will continue to increment with every loop.

How do we keep data from being fetched twice?

If we request a tile + a grid, the data will be fetched twice.

We could:

  • Cache the data
  • Render the grid at the same time as the tile, and keep track if we're doing that so simultaneous requests will still get a response (albeit late)

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.