Skip to content

Instantly share code, notes, and snippets.

@thomaspoignant
Created January 9, 2020 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaspoignant/a6575ae113cc184e436e9e59001f78a8 to your computer and use it in GitHub Desktop.
Save thomaspoignant/a6575ae113cc184e436e9e59001f78a8 to your computer and use it in GitHub Desktop.
const {compileSorter} = require('scim-query-filter-parser');
const {performance} = require('perf_hooks');
const request = require('request');
const scimUsersFile = 'https://gist.githubusercontent.com/thomaspoignant/471a159501bd4eb7b3499d38f81f927d/raw/bac8e75141e24adf4a372c56ebf0adc78578058f/scimUsers.json';
request.get(scimUsersFile, function (error, response, body) {
if (!error && response.statusCode === 200) {
const scimUsers = JSON.parse(body);
const startTime = performance.now();
scimUsers.sort(compileSorter('id'));
const sortTime = Math.round(performance.now() - startTime);
console.log(`Sorting time = ${sortTime} ms for ${scimUsers.length} users.`);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment