contentful / contentful-resolve-response

Resolve items & includes of a Contentful API response into a proper object graph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Performance problems with 100k+ entries

esped-dfds opened this issue · comments

We are trying to build our website with gatsby using gatsby-source-contentful. I've identified a performance problem in the way links are looked up. By using an array as datastructure and doing liniar search, it takes 20-30 mins extra to resolve links.

return findNormalizableLinkInArray(allEntries, predicate);

In my POC I put all the entries in an object with id as key which allowed it to resolve the links immediately.

Looking at the code today it seems like it can support entries and assets with the same id. I don't know if this is a use case that needs to be supported.