Skip to content

Commit

Permalink
adds moar faces
Browse files Browse the repository at this point in the history
  • Loading branch information
carvilsi committed Mar 11, 2024
1 parent f57c645 commit 9839bde
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
18 changes: 9 additions & 9 deletions benchmark/report.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
┌─────────┬──────────────────────────────────┬─────────────┬───────────────────┬──────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼──────────────────────────────────┼─────────────┼───────────────────┼──────────┼─────────┤
│ 0 │ 'random face' │ '2,848,875' │ 351.0156493063962 │ '±4.43%' │ 284888
│ 1 │ 'print all the faces' │ '12,168' │ 82176.5362115329 │ '±0.98%' │ 1218
│ 2 │ 'get one by name; more than one' │ '18,444' │ 54216.00525133655 │ '±1.59%' │ 1845
│ 3 │ 'get one by name; just one' │ '22,486' │ 44471.429739596315 │ '±1.12%' │ 2249
│ 4 │ 'get array of faces by name' │ '18,394' │ 54364.53421640655 │ '±1.51%' │ 1840
└─────────┴──────────────────────────────────┴─────────────┴───────────────────┴──────────┴─────────┘
┌─────────┬──────────────────────────────────┬─────────────┬───────────────────┬──────────┬─────────┐
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├─────────┼──────────────────────────────────┼─────────────┼───────────────────┼──────────┼─────────┤
│ 0 │ 'random face' │ '3,001,424' │ 333.1751560225378 │ '±4.50%' │ 300143
│ 1 │ 'print all the faces' │ '11,477' │ 87124.43310884232 │ '±0.64%' │ 1148
│ 2 │ 'get one by name; more than one' │ '20,640' │ 48448.82368464158 │ '±0.95%' │ 2065
│ 3 │ 'get one by name; just one' │ '20,834' │ 47997.43297003968 │ '±0.61%' │ 2084
│ 4 │ 'get array of faces by name' │ '12,848' │ 77832.82068478376 │ '±2.68%' │ 1286
└─────────┴──────────────────────────────────┴─────────────┴───────────────────┴──────────┴─────────┘
5 changes: 4 additions & 1 deletion src/faces.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ const canonical = {
salute: [ 'o7' ],
john_lennon: [ '//0‑0\\\\' ],
zoidberg: [ '(V) (;, ;) (V)', '(V)(°, °)(V)' ],
sadness_great_dismay_disgust: [ ';v.v', '._.', '._.;' ]
sadness_great_dismay_disgust: [ ';v.v', '._.', '._.;' ],
crying: [ 'QQ', 'qq', 'Qq' ],
dead_person_fainted: [ 'X_X', 'x_x', '+_+', 'X_x', 'x_X' ],
sideways_look_devious_or_guilty: [ '<_<', '>_>', '<.<', '>.>' ]
}
},
kaomoji_faces: {
Expand Down
2 changes: 1 addition & 1 deletion tests/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test('should retrieve an array of faces and a random face', (t) => {
const arrayOfFaces = facetxt.all;

t.true(arrayOfFaces.length > 0, 'the array of faces is empty');
t.is(arrayOfFaces.length, 186);
t.is(arrayOfFaces.length, 198);

const face = facetxt.rand;

Expand Down

0 comments on commit 9839bde

Please sign in to comment.