Created
January 9, 2020 11:22
-
-
Save thomaspoignant/a6575ae113cc184e436e9e59001f78a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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