You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now murmurhash is used for grouping items in the batchExecutor by the item's metadata.
This is the only place where this dependency is used and there are other hashing algorithms like sha implemented in all modern browsers using the crypto.subtle API.
Even more so, all browsers have a Map implementation that's better than O(n), some (like Chromium) even use a hashtable themselves. In these cases the faro-web-sdk is hashing a value, so the hash can be hashed.
Proposed solution
Remove the dependency for murmurhash-js and instead either use Map directly or use the crypto.subtle.digest() for hashing instead.
Context
This would reduce the bundle size by ~1.2kb or 2% (5.6% of faro-core) and improve performance.
The text was updated successfully, but these errors were encountered:
@Snapstromegon - thanks for the suggestion. I am doing a bit of research to see if we can fall back to using the builtin Map. I definitely love to remove dependencies when possible so I am hoping you are right. going to discuss with the team and see what our best approach should be.
Description
Right now murmurhash is used for grouping items in the batchExecutor by the item's metadata.
This is the only place where this dependency is used and there are other hashing algorithms like sha implemented in all modern browsers using the
crypto.subtle
API.Even more so, all browsers have a
Map
implementation that's better than O(n), some (like Chromium) even use a hashtable themselves. In these cases the faro-web-sdk is hashing a value, so the hash can be hashed.Proposed solution
Remove the dependency for murmurhash-js and instead either use
Map
directly or use thecrypto.subtle.digest()
for hashing instead.Context
This would reduce the bundle size by ~1.2kb or 2% (5.6% of faro-core) and improve performance.
The text was updated successfully, but these errors were encountered: