« first day (2219 days earlier)      last day (2255 days later) » 

6:43 AM
@halirutan thanks for feedback, with your heavy example I'm able to reproduce the problem even at home with Win7 and GF GT 960. On VM macOS (GF GT 630) it is noticeably slower than tickfree case but not as glitchy as Windows behavior.
Yes, I will hold on with API monitor for the moment.
 
7:32 AM
@halirutan Thanks halirutan again! A bug it is then.
 
 
2 hours later…
9:47 AM
@b3m2a1 it seems you managed to make use of mutation handler and friends, I'm looking forward to seeing your input then :) mathematica.stackexchange.com/q/165843/5478
 
 
3 hours later…
12:29 PM
OptionQ@<|"a" -> 1, "b" -> 1|>
returns True
Is this expected?
 
 
1 hour later…
1:31 PM
@kuba interesting... I haven’t seen anything pointing in that direction...
 
2:04 PM
@P.Fonseca hard to complain since it is undocumented but still
 
 
3 hours later…
5:31 PM
@Kuba - for your undocumented functions post:
```
In[1]:= (* weak hash maps in WL *)
$HistoryLength = 0

Out[1]= 0

In[2]:= store = Language`NewExpressionStore["label"]

Out[2]= Language`ExpressionStore["label"]

(* x is some l-value, pointing to an expression *)

In[3]:= x = f[2]

Out[3]= f[2]

(* store any key value pairs in the expression store *)

In[4]:= store["put"[x, "key", value]]

(* you can retrieve the values *)

In[5]:= store["get"[x, "key"]]

Out[5]= value

(* caching is done by identity for the expression, so two identical \
I find this to be incredibly useful for caching
 
6:25 PM
@JasonB. Tripple backticks don't work. If you want to post a code-block, make it a new message and paste the code in, mark all and press Ctrl+K to indent it with 4 spaces.
In[1]:= (* weak hash maps in WL *)
$HistoryLength = 0

Out[1]= 0

In[2]:= store = Language`NewExpressionStore["label"]

Out[2]= Language`ExpressionStore["label"]

(* x is some l-value, pointing to an expression *)

In[3]:= x = f[2]

Out[3]= f[2]

(* store any key value pairs in the expression store *)

In[4]:= store["put"[x, "key", value]]

(* you can retrieve the values *)
(ah, you don't need to mark all. Just press Ctrl+K)
 
 
1 hour later…
7:31 PM
@JasonB. feel free to elaborate in an answer, unless that is against rules
 
I don't really know what the rules are, so I just put it here
Perhaps it's lazy of me, but I was assuming @b3m2a1 might see the code above and recognize how useful it is, and post an answer :-)
 
Say you have a HoldFirst function that takes a function (and its parameters) as the first argument (foo_) and you want to extra parts of the parameter sequence of foo in the function. Is it better to use Unevaluated[foo][[3]] or Hold[foo][[1,3]]
 
7:47 PM
In[4]:= Attributes[func] = {HoldFirst}
func[foo : _[args__]] := {args}

Out[4]= {HoldFirst}

In[6]:= func[Graph[{1, 2, 3}, {1 -> 2}]]

Out[6]= {{1, 2, 3}, {1 -> 2}}
 
@JasonB. Yes. I see. Thanks
 
@Edmund ^ is how I normally do it, but from your choices I can't get the Hold version to work, but the Unevaluated one works
 
@JasonB. So this should work as well monitorParallel[pm : ParallelMap[args__]]:=
 
Yes, that should prevent ParallelMap from evaluating
and allow access to its arguments
 
@JasonB. Great. thanks
 
8:25 PM
Monitor and shared variables really slow down parallel processing. Does anyone know of some tricks to speed either up?
ClearAll[monitorParallel];
Attributes[monitorParallel] = {HoldFirst};
monitorParallel[pm : ParallelMap[params__]] :=
Module[{args = {params}, res, levelSpec = 1, exprCount, progress = 0},
(* Count levels *)
If[Length@args >= 3,
With[{expr = args[[3]]},
If[MatchQ[
expr, _Integer | {Repeated[_Integer, {1, 2}]} | Infinity],
levelSpec = expr
]]];
exprCount = Length@Level[args[[2]], levelSpec];

(* Prep parallel processing *)
If[Length@Kernels[] == 0,
LaunchKernels[]
];
SetSharedVariable[progress];
AbsoluteTiming[monitorParallel[ParallelMap[f, Range@Range@1000]];]
AbsoluteTiming[ParallelMap[f, Range@Range@10000];]
Shockingly slow
 
@JasonB. @Kuba gonna get to it soon. Just haven't had the time yet.
 

« first day (2219 days earlier)      last day (2255 days later) »