Ticket #1775 (closed feature: fixed)

Opened 4 years ago

Last modified 3 years ago

Inline hash key_hash and compare functions

Reported by: luben Owned by: jkeenan
Priority: normal Milestone:
Component: core Version: branch
Severity: medium Keywords:
Cc: Language:
Patch status: new Platform:

Description

Move runtime indirection to compile time indirection. This gives us some speedup.

For code review, look at branches/hash_inlined_func

Change History

  Changed 4 years ago by luben

The work is done.

It's ready for testing, review and comments.

  Changed 4 years ago by jkeenan

  • owner set to luben
  • component changed from none to core

Failures observed in this branch in t/pmc/hash.t, most recently at r48871. For full output of prove, see  this paste. Excerpt:

src/hash.c:443: failed assertion 'key'
Backtrace - Obtained 16 stack frames (max trace depth is 32).
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e222c2]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(Parrot_confess+0x9a) [0xb7e2242a]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e355d4]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(parrot_hash_put+0x1ba) [0xb7e360ca]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7ee3cb0]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7dea2ff]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e7c844]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e7b6ea]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e3db15]
/home/jimk/work/hash_inlined_func/blib/lib
  /libparrot.so.2.7.0(Parrot_pcc_invoke_from_sig_object+0x1c2) [0xb7e37a02]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(Parrot_ext_call+0x103) [0xb7e23ef3]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(Parrot_runcode+0x1b2) [0xb7e20d52]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(imcc_run_pbc+0x99) [0xb7f63bd9]
./parrot [0x8049a21]
/lib/libc.so.6(__libc_start_main+0xe5) [0xb70a3455]
./parrot [0x8048df1]
t/pmc/hash.t .. 
1..174
ok 1 - lookup Int in hash
...
ok 85 - clone preserves hash internal order
not ok 86 # TODO 
# 	Failed (TODO) test ''
ok 87 - Str from compound key
...
ok 152 - literal unicode key lookup via var
Failed 22/174 subtests 

Test Summary Report
-------------------
t/pmc/hash.t (Wstat: 6 Tests: 152 Failed: 0)
  Non-zero wait status: 6
  Parse errors: Bad plan.  You planned 174 tests but ran 152.
Files=1, Tests=152,  1 wallclock secs ( 0.03 usr  0.01 sys +  0.23 cusr  0.00 csys =  0.27 CPU)
Result: FAIL

  Changed 4 years ago by chromatic

On Wednesday 08 September 2010 at 20:00, Parrot  wrote:

>  Failures observed in this branch in ''t/pmc/hash.t'', most recently at
>  r48871.  For full output of ''prove'', see [http://nopaste.snit.ch/23275
>  this paste].

r48879 should fix this.

-- c

follow-up: ↓ 5   Changed 4 years ago by luben

It was fixed by chromatic++ - argument annotations were mismatched.

in reply to: ↑ 4   Changed 4 years ago by jkeenan

Replying to luben:

It was fixed by chromatic++ - argument annotations were mismatched.

Unfortunately, no, for me, r48879 did not fix the problem (linux/i386):

$ svn info | ack 'Last.*Rev'
Last Changed Rev: 48879
$ prove t/pmc/hash.t 
t/pmc/hash.t .. 49/174 src/hash.c:476: failed assertion 'a'
Backtrace - Obtained 16 stack frames (max trace depth is 32).
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e292c2]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(Parrot_confess+0x9a) [0xb7e2942a]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e3c2a4]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(parrot_hash_put+0x1fc) [0xb7e3d0dc]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7eec6b1]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7df0c66]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e83814]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e826ba]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0 [0xb7e44ae5]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(Parrot_pcc_invoke_from_sig_object+0x1c2) [0xb7e3e9d2]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(Parrot_ext_call+0x103) [0xb7e2aef3]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(Parrot_runcode+0x1b2) [0xb7e27d52]
/home/jimk/work/hash_inlined_func/blib/lib/libparrot.so.2.7.0(imcc_run_pbc+0x99) [0xb7f6aba9]
./parrot [0x8049a21]
/lib/libc.so.6(__libc_start_main+0xe5) [0xb70aa455]
./parrot [0x8048df1]
t/pmc/hash.t .. Failed 22/174 subtests 

Test Summary Report
-------------------
t/pmc/hash.t (Wstat: 6 Tests: 152 Failed: 0)
  Non-zero wait status: 6
  Parse errors: Bad plan.  You planned 174 tests but ran 152.
Files=1, Tests=152,  1 wallclock secs ( 0.04 usr  0.00 sys +  0.31 cusr  0.02 csys =  0.37 CPU)
Result: FAIL

follow-up: ↓ 7   Changed 4 years ago by chromatic

On Thursday 09 September 2010 at 19:33, Parrot  wrote:

>  Unfortunately, no, for me, r48879 did not fix the problem (linux/i386):
>  {{{
>  $ svn info | ack 'Last.*Rev'
>  Last Changed Rev: 48879
>  }}}
> 
>  {{{
>  $ prove t/pmc/hash.t
>  t/pmc/hash.t .. 49/174 src/hash.c:476: failed assertion 'a'
>  Backtrace - Obtained 16 stack frames (max trace depth is 32).

That's a different but similar problem which r48901 should fix.

-- c

in reply to: ↑ 6   Changed 4 years ago by jkeenan

Replying to chromatic:

That's a different but similar problem which r48901 should fix.

Enfin, ça va! t/pmc/hash.t PASS; now re-running make test.

kid51

  Changed 4 years ago by jkeenan

r48922: continues to PASS make test Linux/i386.

  Changed 3 years ago by jkeenan

  • status changed from new to assigned
  • owner changed from luben to jkeenan

The foregoing discussion refers to a hash_inlined_func branch, but there is no notation in the ticket that indicates if/when the branch was merged into trunk.

However, from study of git blame and git log, it appears that the relevant work was done by Luben Karavelov, Nick Wellnhofer and chromatic back in September and October of last year.

On this assumption, I'm going to take the ticket for the purpose of closing it in two or three days. Any objections or comments?

Thank you very much.

kid51

  Changed 3 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

No comments or complaints; closing ticket.

Note: See TracTickets for help on using tickets.