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

IDEA: Use fst package for loading Cache will boost startup performance #191

Closed
Fpadt opened this issue Apr 17, 2017 · 4 comments
Closed
Labels
Under investigation Default label before an issue is classified as Bug/Feature/...

Comments

@Fpadt
Copy link

Fpadt commented Apr 17, 2017

Dear All,

Who knows how I can get the fst package and it functionality build in the ProjectTemplate functionality

I recently discovered the fst Package fst package
Would like to use this feature for loading the Cache of ProjectTemplate and Cache each standard file as fst based upon config setting

So in case the same file is in the cache with fst extension and the file is just as old or newer this should be loaded.
In case it is older the system should load the normal file and directly save it as .fst

This does the trick

`
load_dt <-
function(pDATA_TABLE, pPATH = PATH_DATA) {

    file_time_format <- "%Y-%m-%d %H:%M:%S"

    # if fst version exists load it when it is more recent else load normal .RData file
  if (file.exists(file_fst) &
      strptime(file.mtime(file_fst)  , format = file_time_format) >=
      strptime(file.mtime(file_RData), format = file_time_format)) {
    assign(pDATA_TABLE,
           read.fst(path = file_fst, as.data.table = TRUE),
           envir = .GlobalEnv)
  } else {
    load(file_RData,  envir = .GlobalEnv)
    write.fst(get(pDATA_TABLE), file_fst)
  }
 
  # return()
}`
@connectedblue
Copy link
Contributor

Hi @Fpadt

Have you synced with the latest version on github rather than CRAN? There are a number of changes to caching which try and handle things in a smarter way (like only re-caching is something has changed for example to save speed).

It doesn't use fst, just the normal RDS format. There could be some portability and speed benefits from migrating to fst.

@Fpadt
Copy link
Author

Fpadt commented Apr 18, 2017

thanks will sync maybe I have an old vesion. build somehting my slef using fst and quite happy

@rsangole rsangole added the Under investigation Default label before an issue is classified as Bug/Feature/... label Apr 23, 2018
@Hugovdberg
Copy link
Collaborator

We should merge this issue with #225, feather doesn't work for all types of data. If we can use fst for all data types with similar performance to feather, then fst should be preferred.

@KentonWhite
Copy link
Owner

OK -- closing this issue and it is referenced in #225.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Under investigation Default label before an issue is classified as Bug/Feature/...
Projects
None yet
Development

No branches or pull requests

5 participants