Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rcpp Adoption in various stages #26

Open
2 of 3 tasks
bedantaguru opened this issue Mar 30, 2020 · 8 comments
Open
2 of 3 tasks

Rcpp Adoption in various stages #26

bedantaguru opened this issue Mar 30, 2020 · 8 comments
Assignees
Labels
Enhancement New feature or request Major Change This issue should result in a major code base change

Comments

@bedantaguru
Copy link
Member

bedantaguru commented Mar 30, 2020

Need to adopt {Rcpp} whenever possible.

  • in LCS
  • in as_cell_df
  • in direction attachment (enhead alternative)
@bedantaguru bedantaguru self-assigned this Mar 30, 2020
@bedantaguru
Copy link
Member Author

LCS implemented in Rcpp

@bedantaguru
Copy link
Member Author

I noticed that Rcpp may not be optimal for large data in as_cell_df

@bedantaguru bedantaguru added Enhancement New feature or request Major Change This issue should result in a major code base change labels Mar 30, 2020
@bedantaguru
Copy link
Member Author

Maybe I need to check memory status by memory.limit()

@bedantaguru
Copy link
Member Author

expr min lq mean median uq max neval
unpivotr::as_cells(df) %>% tidycells::as_cell_df() 634.28278 683.8018 778.8232 781.1177 881.1816 910.1206 10
tidycells::as_cell_df(df, take_col = F) %>% tidycells::as_cell_df() 809.61787 997.8078 993.7125 1007.7760 1031.1863 1057.0500 10
as_cell_df_c2(df) %>% tidycells::as_cell_df() 99.25656 104.2768 133.2668 113.7746 120.1005 331.1366 10
as_cell_df_r(df) %>% tidycells::as_cell_df() 117.50674 123.1997 133.3697 128.3014 136.8042 179.8280 10
as_cell_df_r2(df) %>% tidycells::as_cell_df() 107.92256 109.7794 116.9087 117.5692 121.1555 130.4172 10

@bedantaguru
Copy link
Member Author

as_cell_df_r2 may be a good option to speedup as_cell_df

@bedantaguru
Copy link
Member Author

enhead alternative is not in Rcpp

@bedantaguru
Copy link
Member Author

bedantaguru commented Apr 22, 2020

Check out tidycells_nightly@Rcpp-dep

While LCS is great, is_attachable is poor as compared to R. Maybe my recent knowledge of C++ is not adequate enough to implement the performant version. Also in my opinion heuristic of this level is better to be kept with R.

As of now, there is no way to save Rcpp::cppFunction(). The only option is to create a package.

A package directly can't have an optional dependency on {Rcpp}. [It has to be in Imports at least behaviorally]

Hence the best idea is to remove the dependency. LCS is required in name_suggest which is a small and experimental portion of the package.

Implement #36

@bedantaguru
Copy link
Member Author

source code of LCS can be ported as optional module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Major Change This issue should result in a major code base change
Projects
None yet
Development

No branches or pull requests

1 participant