DorisAmoakohene / Doris-Amoakohene-atime-for-asymptotic-Timings

1 stars 2 forks source link

Writing csv files as the code and plot for article #9

Open DorisAmoakohene opened 1 month ago

DorisAmoakohene commented 1 month ago

@tdhock see this and let me know what you think about using this as the figure and 2

refs write vary cols R new gg

This plot above are plotting for ;

refs.write.vary.cols.R <- atime::references_best(atime.write.vary.cols.R)

which one looks good to show

gg write R

tdhock commented 1 month ago

I don't think it is a good example because there is no asymptotic complexity class difference. it would be better to show an example where one curve is clearly linear, other is clearly quadratic.

DorisAmoakohene commented 1 month ago

very well, will investigate other packages and send another result

tdhock commented 1 month ago

regex TRE vs PCRE vs RE2 would be good

DorisAmoakohene commented 1 month ago

hi @tdhock is this what you meant?

subject.size.vec <- unique(as.integer(10^seq(0, 3.5, l=100)))

atime.list <- atime::atime( N=subject.size.vec, # Vector of sizes. setup={ # Run for each size, before timings: subject <- paste(rep("a", N), collapse="") pattern <- paste(rep(c("a?", "a"), each=N), collapse="") }, times=10, seconds.limit=0.1,

PCRE.match=regexpr(pattern, subject, perl=TRUE), TRE.match=regexpr(pattern, subject, perl=FALSE), RE2.match=re2::re2_match(subject, pattern) )

plot(atime.list)

(best.list <- atime::references_best(atime.list)) plot(best.list)

Screenshot 2024-09-23 121909
tdhock commented 1 month ago

yes I think that example would be good because you can clearly see the difference between PCRE (exponential time) and others (cubic) please remove ".match" from the names also you can probably remove RE2 to simplify (it is the same N^3 asymptotic time complexity as TRE)

DorisAmoakohene commented 1 month ago
  1. best list is it okay to show it like this

or like this

  1. best_fit_asymptotic_time_complexity

tdhock commented 1 month ago

ok. the first plot x min is 10 but would be better 1 both probably need bigger text

DorisAmoakohene commented 1 month ago

ok. the first plot x min is 10 but would be better 1 both probably need bigger text

best list

tdhock commented 1 month ago

there is no N=1 on x axis?

DorisAmoakohene commented 1 month ago

why do I get this error when I run this

atime.list[["measurements"]][N==323, .(expr.name, seconds=median, kilobytes)]
> pred.list <- predict(best.list, seconds=1e-2, kilobytes=10)
Error in `[.data.table`(data.table(unit = names(L)), , { : 
  kilobytes is not a valid unit; argument names of predict must be one of these valid units: seconds
tdhock commented 1 month ago

your machine does not support memory measurement for some reason

DorisAmoakohene commented 1 month ago

@tdhock including code in the overleaf like

\begin{Schunk}
\begin{Sinput}

subject.size.vec <- unique(as.integer(10^seq(0, 2, l=10)))

atime.list <- atime::atime(
  N = subject.size.vec,
  setup = {
    subject <- paste(rep("a", N), collapse="")
    pattern <- paste(rep(c("a?", "a"), each=N), collapse="")
  },
  times = 10,
  seconds.limit = 0.1,
  PCRE = regexpr(pattern, subject, perl=TRUE),
  TRE = regexpr(pattern, subject, perl=FALSE)
)
\end{Sinput}
\end{Schunk}

is giving me errors like:

LaTeX Error: File Sweave.sty' not found.

LaTeX Error: Environment shunk undefined.

‪./DorisAmoakohene.tex, 230‬
You have created an environment (using \begin{…} and \end{…} commands) which is not recognized. Make sure you have included the required package for that environment in your preamble, and that the environment is spelled correctly.

I have spent time looking at it and find solution buts taking too much time, Can you assist

tdhock commented 1 month ago

you need to install Sweave.sty in your latex on overleaf you should upload the file