Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • For ksh, you may want to specify the implementation (AT&T ksh88, AT&T ksh93, pdksh, mksh...) as there's quite a lot of variation between them. For bash, you may want to specify the version. It made some progress lately (that applies also to other shells). Commented Aug 13, 2016 at 15:42
  • @StéphaneChazelas Thanks. I added the versions of the used software and hardware. Commented Aug 13, 2016 at 15:50
  • For reference: to create a process pipeline in python you have to do something like: from subprocess import *; p1=Popen(['echo', 'something'], stdout=PIPE); p2 = Popen(['grep', 'pattern'], stdin=p1.stdout, stdout=PIPE); Popen(['wc', '-c'], stdin=PIPE). This is indeed clumsy, but it shouldn't be hard to code a pipeline function that does this for you for any number of processes, resulting in pipeline(['echo', 'something'], ['grep', 'patter'], ['wc', '-c']). Commented Aug 13, 2016 at 18:11
  • 2
    I thought maybe the gcc optimizer was totally eliminating the loop. It's not, but it's still doing an interesting optimization: it uses SIMD instructions to do 4 adds in parallel, reducing the number of loop iterations to 250000. Commented Aug 13, 2016 at 21:35
  • 1
    @PSkocik: It's right on the edge of what optimizers can do in 2016. It looks like C++17 will mandate that compilers must be able to calculate similar expressions at compile time (not even as an optimization). With that C++ capability in place, GCC may pick it up as an optimization for C as well. Commented Aug 15, 2016 at 12:18