Test filtering of large dataset

by Andrew Holloway

HTML

<p>See Console</p>

<fieldset>
  <legend>Adding more test data</legend>

  <ul>
    <li>Use <a href="https://json-schema-faker.js.org/">JSON Faker to generate new rows for <code>data</code></a></li>
    <li>Use the slightly modified schema from the ticket to generate data from</li>
  </ul>

</fieldset>

JavaScript

const data = [{
  "accountId": "a3d060b5-c795-4415-a3a5-1b39f0134d2f",
  "createdAt": 0,
  "conditions": [{
    "key": "location",
    "resourceId": "test",
    "resource": "application"
  }],
  "priorityOrder": 0,
  "type": "offer"
}, {
  "accountId": "598ab41a-b3b9-4f66-b063-847c8e217199",
  "createdAt": 0,
  "conditions": [{
    "key": "commitment",
    "resourceId": "Manager",
    "resource": "application"
  }],
  "priorityOrder": 0,
  "type": "offer"
}, {
  "accountId": "cc79ac4a-0d07-4a33-9f6e-d14ddb364769",
  "createdAt": 0,
  "conditions": [{
    "key": "department",
    "resourceId": "test",
    "resource": "application"
  }],
  "priorityOrder": 0,
  "type": "offer"
}, {
  "accountId": "545cad6d-7085-4e30-9e3e-591c0cd8d3a8",
  "createdAt": 0,
  "conditions": [{
      "key": "department",
      "resourceId": "test",
      "resource": "application"
    },
    {
      "key": "team",
      "resourceId": "test2",
      "resource": "application"
    }
  ],
  "priorityOrder": 0,
  "type": "offer"
}];

// Modify this function to test how long it takes to run the filter on the given data set
function findDuplicates(data) { return data;}

console.time('find duplicates');


console.log(findDuplicates(data));


console.timeEnd('find duplicates');