Mailinglist Archive: zypp-commit (268 mails)

< Previous Next >
[zypp-commit] r7923 - in /branches/use-solv/libzypp/zypp: Dep.h Dependencies.h
  • From: matz@xxxxxxxxxxxxxxxx
  • Date: Mon, 26 Nov 2007 02:45:38 -0000
  • Message-id: <20071126024538.7780F24492@xxxxxxxxxxxxxxxx>
Author: matz
Date: Mon Nov 26 03:45:38 2007
New Revision: 7923

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7923&view=rev
Log:
Reduce the number of malloc calls by 500000 (from 2 millions!). It's
really no good idea to implement heavily used low-level data structures
with std::map<> or the like.

Modified:
branches/use-solv/libzypp/zypp/Dep.h
branches/use-solv/libzypp/zypp/Dependencies.h

Modified: branches/use-solv/libzypp/zypp/Dep.h
URL:
http://svn.opensuse.org/viewcvs/zypp/branches/use-solv/libzypp/zypp/Dep.h?rev=7923&r1=7922&r2=7923&view=diff
==============================================================================
--- branches/use-solv/libzypp/zypp/Dep.h (original)
+++ branches/use-solv/libzypp/zypp/Dep.h Mon Nov 26 03:45:38 2007
@@ -65,6 +65,7 @@
FRESHENS_e,
ENHANCES_e,
SUPPLEMENTS_e,
+ LAST_e,
};

/** Ctor from string.

Modified: branches/use-solv/libzypp/zypp/Dependencies.h
URL:
http://svn.opensuse.org/viewcvs/zypp/branches/use-solv/libzypp/zypp/Dependencies.h?rev=7923&r1=7922&r2=7923&view=diff
==============================================================================
--- branches/use-solv/libzypp/zypp/Dependencies.h (original)
+++ branches/use-solv/libzypp/zypp/Dependencies.h Mon Nov 26 03:45:38 2007
@@ -31,14 +31,15 @@
struct Dependencies
{
CapSet & operator[]( Dep idx_r )
- { return _capsets[idx_r]; }
+ { return _capsets[idx_r.inSwitch()]; }

const CapSet & operator[]( Dep idx_r ) const
- { return const_cast<std::map<Dep,CapSet>&>(_capsets)[idx_r]; }
+ { return _capsets[idx_r.inSwitch()]; }

private:
- std::map<Dep,CapSet> _capsets;
+ CapSet _capsets[Dep::LAST_e];
};
+
///////////////////////////////////////////////////////////////////

/** \relates Dependencies Stream output */

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages