[parrot/parrot] 6fdc50: [pct]: Switch HLLCompiler's .lineof to a binary s...

noreply at github.com noreply at github.com
Fri Sep 2 18:27:41 UTC 2011

  Branch: refs/heads/master
  Home:   https://github.com/parrot/parrot

  Commit: 6fdc50ae98b966ec544f882232b36683ff108da2
  Author: pmichaud <pmichaud at pobox.com>
  Date:   2011-09-02 (Fri, 02 Sep 2011)

  Changed paths:
    M compilers/pct/src/PCT/HLLCompiler.pir

  Log Message:
  [pct]:  Switch HLLCompiler's .lineof to a binary search instead of linear.

Recent profiling from mls++ on Rakudo's setting compilation seems to
indicate that lineof does a lot of work.  This patch switches the
linear search to a binary search, making an O(n**2) process into
an O(n*log(n)) one.  However, this doesn't seem to translate into
any sort of significant speed improvement in setting compilation,
which makes me think the profiling itself is off.   Still, it's an
easy optimization for now so I'm going ahead and committing it.

More information about the parrot-commits mailing list