Opened 9 years ago

Last modified 8 years ago

#9826 new Bugs

compress boost::property

Reported by: marc.glisse@… Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

Hello,

looking at property_map, I noticed that boost::property is wasting space. property<tag,double> will typically have size 16 because of the no_property member. list_edge<Vertex,no_property> will also be too long for the same reason. A proper use of the empty base optimization (possibly through tuple or compressed_pair) should help with this. Partial specializations for no_property may be a simpler alternative.

Graphs can grow large, and it seems quite important to avoid wasting memory.

Change History (1)

comment:1 by marc.glisse@…, 8 years ago

This appears to be a regression caused by:

commit 616b9e71348b430af89a2405b5b8463557e63dec
Author: Jeremiah Willcock <jewillco@osl.iu.edu>
Date:   Sat Jun 30 20:00:41 2012 +0000

Before that commit, property was implemented with derivation (which is still what the documentation shows...), and the empty base optimization avoided wasting so much space.

Note: See TracTickets for help on using tickets.