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

Mitigate performance impact of R_nchar #36

Open
brodieG opened this issue Mar 6, 2018 · 1 comment
Open

Mitigate performance impact of R_nchar #36

brodieG opened this issue Mar 6, 2018 · 1 comment
Milestone

Comments

@brodieG
Copy link
Owner

brodieG commented Mar 6, 2018

Don't use when we're in character mode instead of width mode, try to see if there is an obvious set of unicode ranges we can just blindly return 1 for.

@brodieG brodieG added this to the 0.1.0 milestone Mar 6, 2018
@brodieG
Copy link
Owner Author

brodieG commented Mar 7, 2018

Looks like the impact is not horrendous:

> system.time(txt.w1 <- strwrap2_esc(ulysses.c, 25, pad.end=" ", wrap.always=TRUE))
   user  system elapsed 
  0.247   0.003   0.251 
> system.time(txt.w2 <- strwrap2_esc(utf8.c, 25, pad.end=" ", wrap.always=TRUE))
   user  system elapsed 
  0.955   0.006   0.965 

Obviously not good, but not completely crushing either. utf8.c is all utf8 chars (russian/chinese)

@brodieG brodieG modified the milestones: 0.1.0, 0.2.0 Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant