User bio
404 bio not found
Member since Jan 27, 2016
Posts:
Replies:
In other words, it's a kind of performance optimization when using $increment
I was surprised when discovered that $increment with locals is not so well optimized as it can be and as it is for globals. A small proof:
USER> set top=1E7,^||a=0,t=$zh for i=1:1:top {set ^||a=$get(^||a)+1} w $fn($zh-t*1E6/top,"",3)
0.265
USER> set top=1E7,^||a=0,t=$zh for i=1:1:top {do $i(^||a)} w $fn($zh-t*1E6/top,"",3)
0.176
USER> set top=1E7,a=0,t=$zh for i=1:1:top {set a=$get(a)+1} w $fn($zh-t*1E6/top,"",3)
0.050
USER> set top=1E7,a=0,t=$zh for i=1:1:top {do $i(a)} w $fn($zh-t*1E6/top,"",3)
0.056
I intentionally inserted $get() call just to make samples functionality closer to each other.
It's rather difficult to get for what reason $i(a) is not just the same as `set a=$get(a)+1` as it's nothing to do with TP and other globals related stuff here?
Maybe nobody was interested in deeper optimization of $i() in this context...
Robert,
don't you think that traditional (row) storage w/o any indexing would be slow anyway?
If so, maybe the results DemoB are worth publishing as well.
Open Exchange applications:
Certifications & Credly badges:
Alexey has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following:
Alexey has not followed anybody yet.
Hi Seisuke,
1) Thank you for reminding about this shortcut and for sharing the associated workaround.
2) Agree.