Re: [R-pkg-devel] Searching examples in source code

2022-05-08 Thread Joshua Ulrich
Hi Ben,

On Sat, May 7, 2022 at 4:24 PM Ben Engbers  wrote:
>
> Hi,
>
> My package (RBaseX) is written entirely in R. The performance is not bad
> but to further improve the performance I want to investigate to what
> extent use of C++ makes sense. Problem is that I have little experience
> with C++ and none with Rcpp. So I am looking for examples.
> On my (linux) system I installed several packages that needed to be
> compiled. So it is likely that I already have examples on my system.
>
I strongly recommend you profile your code to determine where there
are performance bottlenecks before writing any new code. Especially
before adding compiled code to your package.

The infamous Knuth quote:
"We should forget about small efficiencies, say about 97% of the time:
premature optimization is the root of all evil. Yet we should not pass
up our opportunities in that critical 3%. A good programmer will not
be lulled into complacency by such reasoning, he will be wise to look
carefully at the critical code; but only after that code has been
identified."

Best,
Josh

> My first question is if there is a useful linux command to search all
> the source code of installed packages on my system.
> The second question is if there is a command to search all packages at
> https://cran.r-project.org/web/packages/available_packages_by_name.html?
>
> This question is not only relevant to C++ examples. It would also be
> nice if you could search for occurrences of commands in R code.
>
> Ben
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Searching examples in source code

2022-05-08 Thread Greg Hunt
Indeed, and since this is a database client, the question is not just the
elapsed time of the client code, but the optimisation opportunities need to
be viewed as a proportion of the overall request time: client time, network
time, typical and minimum database server time.

On Mon, 9 May 2022 at 05:24, Joshua Ulrich  wrote:

> Hi Ben,
>
> On Sat, May 7, 2022 at 4:24 PM Ben Engbers 
> wrote:
> >
> > Hi,
> >
> > My package (RBaseX) is written entirely in R. The performance is not bad
> > but to further improve the performance I want to investigate to what
> > extent use of C++ makes sense. Problem is that I have little experience
> > with C++ and none with Rcpp. So I am looking for examples.
> > On my (linux) system I installed several packages that needed to be
> > compiled. So it is likely that I already have examples on my system.
> >
> I strongly recommend you profile your code to determine where there
> are performance bottlenecks before writing any new code. Especially
> before adding compiled code to your package.
>
> The infamous Knuth quote:
> "We should forget about small efficiencies, say about 97% of the time:
> premature optimization is the root of all evil. Yet we should not pass
> up our opportunities in that critical 3%. A good programmer will not
> be lulled into complacency by such reasoning, he will be wise to look
> carefully at the critical code; but only after that code has been
> identified."
>
> Best,
> Josh
>
> > My first question is if there is a useful linux command to search all
> > the source code of installed packages on my system.
> > The second question is if there is a command to search all packages at
> > https://cran.r-project.org/web/packages/available_packages_by_name.html?
> >
> > This question is not only relevant to C++ examples. It would also be
> > nice if you could search for occurrences of commands in R code.
> >
> > Ben
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>
>
> --
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  www.fosstrading.com
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel