[Rcpp-devel] Faster lookup: Named Rcpp::List or std::map?
Dirk Eddelbuettel
edd at debian.org
Wed Jul 23 16:17:15 CEST 2014
On 23 July 2014 at 15:30, Asis Hallab wrote:
| Dear Rcpp-Experts,
|
| trying to optimize my algorithm I face the question wether a lookup by
| a string key like e.g.
|
| myRcppList( "my_entry" ) is as fast as the lookup in std::maps?
|
| That said, would you recommend converting myRcppList to a std::map
| before searching it?
Why don't you time / profile both and pick the faster one?
Profiling is generally a good idea. Bottlenecks are sometimes seen in
corners you least suspected.
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
More information about the Rcpp-devel
mailing list