Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
00052a60
Commit
00052a60
authored
Jan 05, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add container_test
parent
9d080b08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
0 deletions
+142
-0
CHANGELOG.txt
CHANGELOG.txt
+11
-0
container_test.cpp
container_test.cpp
+131
-0
No files found.
CHANGELOG.txt
View file @
00052a60
2012-Jan-5 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++all
Ki_PageDescr was re-written as a proper C++ class and renamed to PAGE_INFO.
It describes paper. The m_Offset field was dropped since it was only used
in HPGL plotting within EESCHEMA. PAGE_INFO instance was moved out of
BASE_SCREEN (which is on its way out) into both SCH_SCREEN and BOARD.
KiCad ChangeLog 2011
====================
Please add newer entries at the top, list the date and your name with
email address.
2011-Dec-19, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
Pcbnew:
...
...
container_test.cpp
0 → 100644
View file @
00052a60
#include <base_struct.h>
#include <boost/ptr_container/ptr_vector.hpp>
#include <deque>
#include <dlist.h>
#include <time.h>
#define TEST_NODES 100000000
//typedef std::vector<EDA_ITEM*> EDA_ITEMV;
//typedef std::deque<EDA_ITEM*> EDA_ITEMV;
typedef
boost
::
ptr_vector
<
EDA_ITEM
>
EDA_ITEMV
;
void
heap_warm_up
();
/**
* Function GetRunningMicroSecs
* returns current relative time in microsecs.
*/
unsigned
GetRunningMicroSecs
()
{
struct
timespec
now
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
now
);
unsigned
usecs
=
now
.
tv_nsec
/
1000
+
now
.
tv_sec
*
1000
*
1000
;
return
usecs
;
}
int
main
(
int
argc
,
char
**
argv
)
{
EDA_ITEMV
v
;
DLIST
<
EDA_ITEM
>
dlist
;
unsigned
vAllocStart
;
unsigned
vAllocStop
;
unsigned
vIterateStart
;
unsigned
vIterateStop
;
unsigned
dAllocStart
;
unsigned
dAllocStop
;
unsigned
dIterateStart
;
unsigned
dIterateStop
;
heap_warm_up
();
vAllocStart
=
GetRunningMicroSecs
();
for
(
int
i
=
0
;
i
<
TEST_NODES
;
++
i
)
{
v
.
push_back
(
new
EDA_ITEM
(
NOT_USED
)
);
}
vAllocStop
=
GetRunningMicroSecs
();
vIterateStart
=
vAllocStop
;
for
(
EDA_ITEMV
::
const_iterator
it
=
v
.
begin
();
it
!=
v
.
end
();
++
it
)
{
if
(
it
->
Type
()
==
-
22
)
{
printf
(
"never this
\n
"
);
break
;
}
}
vIterateStop
=
GetRunningMicroSecs
();
#if 0
for( int i=0; i<TEST_NODES; ++i )
{
delete v[i];
}
#endif
v
.
clear
();
dAllocStart
=
GetRunningMicroSecs
();
for
(
int
i
=
0
;
i
<
TEST_NODES
;
++
i
)
{
dlist
.
PushBack
(
new
EDA_ITEM
(
NOT_USED
)
);
}
dAllocStop
=
GetRunningMicroSecs
();
dIterateStart
=
dAllocStop
;
for
(
const
EDA_ITEM
*
it
=
dlist
;
it
;
it
=
it
->
Next
()
)
{
if
(
it
->
Type
()
==
-
22
)
{
printf
(
"never this
\n
"
);
break
;
}
}
dIterateStop
=
GetRunningMicroSecs
();
printf
(
"vector alloc: %u usecs iterate: %u usecs
\n
"
,
vAllocStop
-
vAllocStart
,
vIterateStop
-
vIterateStart
);
printf
(
"dlist alloc: %u usecs iterate: %u usecs
\n
"
,
dAllocStop
-
dAllocStart
,
dIterateStop
-
dIterateStart
);
}
void
heap_warm_up
()
{
// dry run allocate enough object for process to obtain all memory needed
EDA_ITEMV
vec
;
for
(
int
i
=
0
;
i
<
TEST_NODES
;
++
i
)
{
vec
.
push_back
(
new
EDA_ITEM
(
NOT_USED
)
);
}
for
(
int
i
=
0
;
i
<
TEST_NODES
;
++
i
)
{
// delete vec[i];
}
vec
.
clear
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment