Ticket #4128 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

Optimize xmt_hash_set and xmt_hash_table for POD types

Reported by: gemacke Owned by: gemacke
Priority: normal Milestone: 1.2
Version: 1.1.1 Severity: normal
Keywords: Cc:

Description

All the improvements to xmt_hash_set and xmt_hash_table to make them support objects correctly had a couple of unexpected side-effects. The XMT doesn't compile away placement new to the exact same operations as equal for POD. Thus, using new for an array of ints slightly increases the cost compared to using plain old equals. We also are getting compiler warnings about loops not iterating caused by loops calling the destructors (which don't exist for POD).

To improve these issues, we will use the construct and destroy functions from mtgl/struct_base.hpp which utilize the is_trivial type trait. The user can extend this trait as needed.

Change History

comment:1 Changed 6 years ago by gemacke

  • Status changed from new to accepted

comment:2 Changed 6 years ago by gemacke

  • Status changed from accepted to closed
  • Resolution set to fixed

Addressed in r3828.

Note: See TracTickets for help on using tickets.