Project

General

Profile

Actions

Feature #4183

closed

Optimize Name::append with inplace Component construction

Added by Junxiao Shi over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Base
Target version:
Start date:
07/12/2017
Due date:
% Done:

0%

Estimated time:
1.50 h

Description

Currently, Name::append operates as:

  1. Construct a Component.
  2. Add it as a sub-element into Name's underly Block.

This incurs a copying of the Component (same type as Block).

This procedure can be optimized as:

  1. Introduce a Block::emplace_back method that construct a Block in-place at the end of m_elements.
  2. Call m_wire.emplace_back from Name::append overloads where applicable.
Actions #1

Updated by Junxiao Shi over 7 years ago

  • Assignee set to Junxiao Shi
Actions #2

Updated by Junxiao Shi over 7 years ago

  • Status changed from New to In Progress
Actions #3

Updated by Junxiao Shi over 7 years ago

  • Status changed from In Progress to New
  • Assignee deleted (Junxiao Shi)

I see very little benefits in using emplace_back. Component is a subclass of Block, but I'm unable to call Component constructor from std::vector<Block>::emplace_back.

Actions #4

Updated by Junxiao Shi over 7 years ago

  • Status changed from New to Rejected

As stated in note-3, there's no benefit pursuing this.

Actions

Also available in: Atom PDF