mirror: A fast canonicalisation utility for stable object equality
0

Configure Feed

Select the types of activity you want to include in your feed.

chore: adds `tiny-stable-stringify` as a benchmark candidate

Marais Rossouw (Jul 23, 2024, 9:57 AM +1000) fe49ab56 36e50163

+15 -5
+6 -1
bench/deno.lock
··· 4 4 "specifiers": { 5 5 "npm:@marais/bench": "npm:@marais/bench@0.0.8", 6 6 "npm:json-stable-stringify": "npm:json-stable-stringify@1.1.1", 7 - "npm:object-hash": "npm:object-hash@3.0.0" 7 + "npm:object-hash": "npm:object-hash@3.0.0", 8 + "npm:tiny-stable-stringify": "npm:tiny-stable-stringify@0.1.3" 8 9 }, 9 10 "npm": { 10 11 "@marais/bench@0.0.8": { ··· 126 127 "gopd": "gopd@1.0.1", 127 128 "has-property-descriptors": "has-property-descriptors@1.0.2" 128 129 } 130 + }, 131 + "tiny-stable-stringify@0.1.3": { 132 + "integrity": "sha512-dkqJwMg6uHTlmXREDkvIkHtbgwKpTZ6cfcZSH1rXJEFhH8lhS6pvZk+mUbHXE6LLLyte4X6EGjaFj+pfBmPlcA==", 133 + "dependencies": {} 129 134 } 130 135 } 131 136 },
+4
bench/index.ts
··· 2 2 3 3 import objectHash from 'npm:object-hash'; 4 4 import jsonStableStringify from 'npm:json-stable-stringify'; 5 + import { stringify as tinyStableStringify } from 'npm:tiny-stable-stringify'; 5 6 6 7 import { identify } from '../mod.ts'; 7 8 ··· 28 29 }, 29 30 'json-stable-stringify'() { 30 31 return (o) => jsonStableStringify(o); 32 + }, 33 + 'tiny-stable-stringify'() { 34 + return (o) => tinyStableStringify(o); 31 35 }, 32 36 }, 33 37 (run) => {
+5 -4
readme.md
··· 49 49 50 50 ## 💨 Benchmark 51 51 52 - > via the [`/bench`](/bench) directory with deno 1.41.3 52 + > via the [`/bench`](/bench) directory with deno 1.45.2 53 53 54 54 ``` 55 - ✔ object-identity ~ 14,646,170 ops/sec ± 0.10% 56 - ✔ object-hash ~ 144,060 ops/sec ± 0.01% 57 - ✔ json-stable-stringify ~ 638,559 ops/sec ± 0.01% 55 + ✔ object-identity ~ 13,888,888 ops/sec ± 2.35% 56 + ✔ object-hash ~ 126,262 ops/sec ± 0.20% 57 + ✔ json-stable-stringify ~ 664,893 ops/sec ± 0.51% 58 + ✔ tiny-stable-stringify ~ 642,673 ops/sec ± 0.50% 58 59 ``` 59 60 60 61 > ^ `object-identity` is not as feature-full it's alternatives, specifically around `function`