Giter VIP home page Giter VIP logo

Comments (2)

gicmo avatar gicmo commented on August 22, 2024

By looking at the stack trace below the culprit seems to be pandora::Group::hasGroup(std::string) const where we iterate over all objects and call getObjnameByIdx().
Stack Trace:

Running Time    Self        Symbol Name
3222.0ms  100.0%    0.0     Main Thread  0x38a096
3215.0ms   99.7%    0.0      start
3215.0ms   99.7%    0.0       main
3215.0ms   99.7%    0.0        CppUnit::TestRunner::run(CppUnit::TestResult&, std::string const&)
3215.0ms   99.7%    0.0         CppUnit::TestResult::runTest(CppUnit::Test*)
3215.0ms   99.7%    0.0          CppUnit::TestComposite::run(CppUnit::TestResult*)
3215.0ms   99.7%    0.0           CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*)
3215.0ms   99.7%    0.0            CppUnit::TestComposite::run(CppUnit::TestResult*)
3215.0ms   99.7%    0.0             CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*)
3215.0ms   99.7%    0.0              CppUnit::TestCase::run(CppUnit::TestResult*)
3215.0ms   99.7%    0.0               CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::string const&)
3215.0ms   99.7%    0.0                CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&)
3215.0ms   99.7%    0.0                 CppUnit::ProtectorChain::ProtectFunctor::operator()() const
3215.0ms   99.7%    0.0                  CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&)
3215.0ms   99.7%    0.0                   CppUnit::TestCaseMethodFunctor::operator()() const
3164.0ms   98.1%    0.0                    CppUnit::TestCaller::runTest()
3104.0ms   96.3%    0.0                     TestSection::testAddAndRemove()
1214.0ms   37.6%    0.0                      pandora::Section::children() const
1214.0ms   37.6%    0.0                       pandora::SectionIterator::SectionIterator(pandora::File*, pandora::Group, std::string)
1214.0ms   37.6%    0.0                        pandora::SectionIterator::SectionIterator(pandora::File*, pandora::Group, std::string)
1214.0ms   37.6%    0.0                         pandora::SectionIterator::nextIndex(unsigned long) const
1206.0ms   37.4%    0.0                          pandora::Group::openGroup(std::string, bool) const
1203.0ms   37.3%    0.0                           pandora::Group::hasGroup(std::string) const
     3.0ms     0.0% 0.0                           H5::CommonFG::openGroup(std::string const&) const
     5.0ms     0.1% 0.0                          pandora::Group::objectName(unsigned long) const
     3.0ms     0.0% 0.0                          pandora::SectionIterator::matchesParent(pandora::Group) const
 927.0ms   28.7%    0.0                      pandora::File::removeSection(std::string, bool)
 612.0ms   18.9%    0.0                       pandora::File::removeSection(std::string, bool)
 608.0ms   18.8%    0.0                        pandora::Section::hasChildren() const
 608.0ms   18.8%    0.0                         pandora::Section::children() const
 608.0ms   18.8%    0.0                          pandora::SectionIterator::SectionIterator(pandora::File*, pandora::Group, std::string)
 608.0ms   18.8%    0.0                           pandora::SectionIterator::SectionIterator(pandora::File*, pandora::Group, std::string)
 608.0ms   18.8%    0.0                            pandora::SectionIterator::nextIndex(unsigned long) const
 601.0ms   18.6%    0.0                             pandora::Group::openGroup(std::string, bool) const
 601.0ms   18.6%    0.0                              pandora::Group::hasGroup(std::string) const
 595.0ms   18.4%    2.0                               pandora::Group::hasObject(std::string) const
    5.0ms    0.1%   0.0                               H5::CommonFG::getObjinfo(char const*, H5G_stat_t&) const
    1.0ms    0.0%   1.0                               DYLD-STUB$$std::basic_string, std::allocator >::~basic_string()
    6.0ms    0.1%   0.0                             pandora::Group::objectName(unsigned long) const
    1.0ms    0.0%   0.0                             pandora::Group::~Group()
    2.0ms    0.0%   0.0                        pandora::Group::removeGroup(std::string)
    1.0ms    0.0%   0.0                        pandora::File::getSection(std::string)
    1.0ms    0.0%   0.0                        pandora::File::hasSection(std::string) const
  293.0ms    9.0%   0.0                       pandora::SectionIterator::operator++()
    16.0ms    0.4%  0.0                       pandora::Section::hasChildren() const
      6.0ms    0.1% 0.0                       pandora::Section::children() const
 611.0ms   18.9%    0.0                      pandora::Section::removeSection(std::string, bool)
 611.0ms   18.9%    0.0                       pandora::File::removeSection(std::string, bool)
 603.0ms   18.7%    0.0                        pandora::Section::hasChildren() const
 603.0ms   18.7%    0.0                         pandora::Section::children() const
 603.0ms   18.7%    0.0                          pandora::SectionIterator::SectionIterator(pandora::File*, pandora::Group, std::string)
 603.0ms   18.7%    0.0                           pandora::SectionIterator::SectionIterator(pandora::File*, pandora::Group, std::string)
 603.0ms   18.7%    0.0                            pandora::SectionIterator::nextIndex(unsigned long) const
 597.0ms   18.5%    0.0                             pandora::Group::openGroup(std::string, bool) const
 592.0ms   18.3%    0.0                              pandora::Group::hasGroup(std::string) const
    3.0ms    0.0%   0.0                              H5::CommonFG::openGroup(std::string const&) const
    1.0ms    0.0%   0.0                              pandora::Group::~Group()
    1.0ms    0.0%   1.0                              pandora::Group::hasObject(std::string) const
    4.0ms    0.1%   0.0                             pandora::Group::objectName(unsigned long) const
    1.0ms    0.0%   0.0                             pandora::Group::~Group()
    1.0ms    0.0%   1.0                             pandora::SectionIterator::matchesParent(pandora::Group) const
    4.0ms    0.1%   0.0                        pandora::File::getSection(std::string)
    2.0ms    0.0%   0.0                        pandora::File::hasSection(std::string) const
    2.0ms    0.0%   0.0                        pandora::Group::removeGroup(std::string)
303.0ms    9.4% 0.0                      pandora::Section::childCount() const
  19.0ms    0.5%    0.0                      pandora::File::createSection(std::string, std::string, std::string)
   16.0ms    0.4%   0.0                      pandora::Section::addSection(std::string, std::string)
    9.0ms    0.2%   0.0                      pandora::Section::hasChildren() const
    5.0ms    0.1%   0.0                      pandora::File::getSection(std::string) 
  34.0ms    1.0%    0.0                     TestSection::testAddingProperties()
   18.0ms   0.5%    0.0                     TestSection::testAccessingProperties()
    8.0ms    0.2%   0.0                     TestSection::testRemovingProperties()
  38.0ms    1.1%    0.0                    CppUnit::TestCaller::runTest()

from nix.

gicmo avatar gicmo commented on August 22, 2024

We should use H5Lexist. I have some vague memory that this function was not available on some ubuntu versions but I might not correctly remember it. For now I will commit the following work-around:

  herr_t res;
  H5E_BEGIN_TRY
  res = H5Gget_objinfo(h5group.getId(), name.c_str(), true, NULL);
  H5E_END_TRY
  return res >= 0;

I don't like the additional H5Gget_objinfo we do later in hasData or hasGroup but that will go away once we use the H5Lexist anyway

from nix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.