Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frank Winklmeier
athena
Commits
90b17ad2
Commit
90b17ad2
authored
1 month ago
by
Frank Winklmeier
Browse files
Options
Downloads
Patches
Plain Diff
CLIDComps: add handle performance test
parent
23f49af0
Branches
run2-patches
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Control/CLIDComps/CMakeLists.txt
+7
-1
7 additions, 1 deletion
Control/CLIDComps/CMakeLists.txt
Control/CLIDComps/test/Handle_test.cxx
+56
-0
56 additions, 0 deletions
Control/CLIDComps/test/Handle_test.cxx
with
63 additions
and
1 deletion
Control/CLIDComps/CMakeLists.txt
+
7
−
1
View file @
90b17ad2
# Copyright (C) 2002-202
1
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-202
5
CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir
(
CLIDComps
)
...
...
@@ -28,6 +28,12 @@ atlas_add_test( ClassIDSvc_test
LINK_LIBRARIES AthenaKernel GaudiKernel TestTools
ENVIRONMENT
"JOBOPTSEARCHPATH=
${
CMAKE_CURRENT_SOURCE_DIR
}
/share"
)
atlas_add_test
(
Handle_test
SOURCES test/Handle_test.cxx
LINK_LIBRARIES AthenaKernel GaudiKernel StoreGateLib TestTools
ENVIRONMENT
"JOBOPTSEARCHPATH=
${
CMAKE_CURRENT_SOURCE_DIR
}
/share"
POST_EXEC_SCRIPT nopost.sh
)
atlas_add_test
(
clid
SCRIPT
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/clid_unittest.py
LOG_IGNORE_PATTERN
"Ran 3 tests in"
)
...
...
This diff is collapsed.
Click to expand it.
Control/CLIDComps/test/Handle_test.cxx
0 → 100644
+
56
−
0
View file @
90b17ad2
// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
#include
<chrono>
#include
<iostream>
#include
<thread>
#include
<vector>
#include
<GaudiKernel/DataObjID.h>
#include
"AthenaKernel/CLASS_DEF.h"
#include
"StoreGate/ReadHandle.h"
#include
"TestTools/initGaudi.h"
class
Foo
{};
CLASS_DEF
(
Foo
,
8101
,
0
)
void
run
(
int
threadId
)
{
std
::
cout
<<
"Thread "
<<
threadId
<<
" started."
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
1000000
;
++
i
)
{
SG
::
ReadHandle
<
Foo
>
rh
;
//rh.fullKey().className();
}
std
::
cout
<<
"Thread "
<<
threadId
<<
" finished."
<<
std
::
endl
;
}
int
main
()
{
ISvcLocator
*
pSvcLoc
(
0
);
if
(
!
Athena_test
::
initGaudi
(
"ClassIDSvc_test.txt"
,
pSvcLoc
))
{
std
::
cerr
<<
"ClassIDSvc_test can not be run"
<<
std
::
endl
;
return
1
;
}
const
int
numThreads
=
8
;
std
::
vector
<
std
::
thread
>
threads
;
auto
start
=
std
::
chrono
::
high_resolution_clock
::
now
();
for
(
int
i
=
0
;
i
<
numThreads
;
++
i
)
{
threads
.
emplace_back
(
run
,
i
);
// Pass thread ID to the function
}
for
(
auto
&
thread
:
threads
)
{
thread
.
join
();
// Wait for all threads to finish
}
auto
stop
=
std
::
chrono
::
high_resolution_clock
::
now
();
std
::
cout
<<
"All threads have finished in "
<<
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
stop
-
start
).
count
()
<<
" ms"
<<
std
::
endl
;
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment