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
Copy file name to clipboardExpand all lines: Readme.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ This javascript function memoizer uses an array based structure for storage whic
5
5
6
6
#### Performance Differences
7
7
8
-
Fencache can memoize math functions in practice over tens times as quickly as the best popular libraries, because unlike them it does not use native objects for storage. Native objects cast numeric keys to strings which is a big performance hit working with floating point values.
8
+
Fencache can memoize math functions in practice much faster than other popular memoizers, as it does not use native objects for storage. Native objects cast numeric keys to strings which is a big performance hit working with floating point values.
9
9
10
-
Fencache also efficiently sorts its array based cache on every hit so the most frequently seen values are returned most quickly. It also sets a limit to the number of cached input/output pairs and it overwrites the most unused values instead of growing an excessive memory demand, which is a vulnerability that most object store based memoizers have.
10
+
Fencache also does a sort step in its array based cache on every hit so the most frequently seen values are returned most quickly. It also sets a limit to the number of cached input/output pairs and it overwrites the most unused values instead of growing an excessive memory demand, which is a vulnerability that most object store based memoizers have.
11
11
12
12
#### Storage structure
13
13
@@ -40,7 +40,7 @@ Cache size of 1 is streamlined with no cache management; ideal for when the calc
40
40
41
41
### Native store mode
42
42
43
-
Size 0 sets native storage mode, negative value limits the native store size.
43
+
Size 0 sets native storage mode, a negative value limits the native store size.
44
44
```
45
45
enReply = fencache(reply, 0) //use the native object as cache
46
46
enReply = fencache(reply, -1000) //flushes half the cache after 1000 different entries
@@ -55,7 +55,7 @@ This mode may perform better for keeping thousands of equally distributed calcul
55
55
```
56
56
In this case where calcOnObj takes objects and processes data within them,
57
57
a function in the third parameter can return a value to use as the storage key.
58
-
Without this function, in default mode objects are identified by their native reference (not contents), in native object mode they are automatically stringified. Memoized functions can take up to 5 arguments but a keying function is then needed to id results to the multiple input arguments:
58
+
Without this function, in fencaches default mode objects are identified by their native reference (not contents), in the native object mode they are automatically stringified. Memoized functions can take up to 5 arguments but a keying function is then needed to id results to the multiple input arguments:
0 commit comments