70std::unique_ptr<BOARD> buildBoardWithGroups( std::size_t aGroupCount, std::size_t aTotalShapes )
72 auto board = std::make_unique<BOARD>();
75 std::vector<PCB_GROUP*> groups;
76 groups.reserve( aGroupCount );
78 for( std::size_t g = 0; g < aGroupCount; ++g )
81 group->SetName( wxString::Format( wxT(
"G%zu" ), g ) );
83 groups.push_back(
group );
86 for( std::size_t i = 0; i < aTotalShapes; ++i )
89 int x =
static_cast<int>( i );
97 groups[i % groups.size()]->AddItem( shape );
110double saveBoardSeconds(
const std::filesystem::path& aDir, std::size_t aGroupCount,
111 std::size_t aTotalShapes )
113 auto board = buildBoardWithGroups( aGroupCount, aTotalShapes );
115 const std::filesystem::path savePath =
116 aDir / (
"groups" + std::to_string( aGroupCount ) +
".kicad_pcb" );
122 return timer.
msecs() / 1000.0;
144 constexpr std::size_t kTotalShapes = 5000;
150 (void) saveBoardSeconds( tempDir.
Path(), 10, 100 );
155 [&]( std::size_t aGroupCount )
157 double best = std::numeric_limits<double>::infinity();
159 for(
int run = 0; run < 2; ++run )
161 best = std::min( best, saveBoardSeconds( tempDir.
Path(), aGroupCount,
168 double t100 = bestSave( 100 );
169 double t5000 = bestSave( 5000 );
176 const double floorSec = 0.005;
177 double ratio = t5000 / std::max( t100, floorSec );
185 BOOST_CHECK_LT( ratio, 20.0 );
constexpr EDA_IU_SCALE pcbIUScale
General utilities for PCB file IO for QA programs.
const std::filesystem::path & Path() const
Get the path to the temporary directory as a std::filesystem::path.
static const LSET & AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
A set of BOARD_ITEMs (i.e., without duplicates).
void SetEnd(const VECTOR2I &aEnd) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStart(const VECTOR2I &aStart) override
void SetStroke(const STROKE_PARAMS &aStroke) override
A small class to help profiling.
void Stop()
Save the time when this function was called, and set the counter stane to stop.
double msecs(bool aSinceLast=false)
Simple container to manage line stroke parameters.
void DumpBoardToFile(BOARD &board, const std::filesystem::path &aFilename)
Utility function to simply write a Board out to a file.
Class to handle a set of BOARD_ITEMs.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
VECTOR2< int32_t > VECTOR2I