Timeline for Throwaway memoization makes built-ins faster?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 6, 2017 at 22:06 | comment | added | jkuczm | @CarlWoll Thanks, this seems to be crucial. | |
| May 6, 2017 at 21:48 | history | edited | jkuczm | CC BY-SA 3.0 | Add version without `pick` and with `data` matrix. |
| May 6, 2017 at 15:41 | comment | added | Carl Woll | You are using a vector RandomChoice[Range[0, 10], k] as data, while everybody else is using a matrix, e.g., RandomChoice[Range[0, 10], {k, 3}] as data. | |
| May 6, 2017 at 14:28 | comment | added | webcpu | As I mentioned before, there is a problem in testMemo. the last statement in testMemo should be Pick[data, unitize@data, 1] // AbsoluteTiming // First but not pick[data, unitize@data, 1] // AbsoluteTiming // First . | |
| May 6, 2017 at 14:13 | comment | added | jkuczm | @Shadowray I get {0.033196, Null}. | |
| May 6, 2017 at 13:55 | comment | added | Ray Shadow | @jkuczm Could you, please, measure this time $HistoryLength = 0; garbage = ConstantArray[0, 10^8]; AbsoluteTiming[Remove[garbage]] on your system? | |
| May 6, 2017 at 13:51 | history | edited | jkuczm | CC BY-SA 3.0 | Add tests on fresh kernel. |
| May 5, 2017 at 19:01 | comment | added | webcpu | If you only run Pick once and then Clear all of definitions, pick is not necessary, and you can use Pick instead. You will see that testMemo is the fastest. | |
| May 5, 2017 at 18:58 | comment | added | webcpu | testMemo@data_ := (ClearSystemCache[]; ClearAll[unitize, pick]; unitize[x_] := unitize[x] = Unitize[x]; (pick[xs_,sel_,patt_]:=pick[xs]=Pick[xs,sel,patt];) Pick[data, unitize@data, 1] // AbsoluteTiming // First) | |
| May 5, 2017 at 18:08 | history | answered | jkuczm | CC BY-SA 3.0 |