-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Description
Context
- node version: 8.9.4
- joi version: 13.1.1
- environment (node, browser): NodeJS
- used with (hapi, standalone, ...): standalone
- any other relevant information: -
What are you trying to achieve or the steps to reproduce ?
const Joi = require('joi');
const list = [];
for (let i = 10000; i < 50000; i++) {
list.push(i.toString());
}
const filteredList = list.filter(x => !['12345', '23456', '34567', '456789'].includes(x));
console.time();
Joi.object().keys({
foo: Joi.string().valid(filteredList),
});
console.timeEnd();Which result you had ?
It works very slow (25385.524ms - almost half a minute).
What did you expect ?
It should work much faster (shorter than 1 second).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement