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

Optimize date parsing #735

Merged
merged 3 commits into from May 29, 2017
Merged

Conversation

@rxaviers
Copy link
Member

rxaviers commented May 26, 2017

Make runtime phase lighter. Move weight from runtime to setup phase.

@rxaviers
Copy link
Member Author

rxaviers commented May 29, 2017

Size diff: (significant date size reduction)

   raw     gz Compared to master @ 5d1379688667684fa5754448130d468b4d253dcd    
     =      = tmp/globalize.min.js                                             
     =      = tmp/globalize/currency.min.js                                    
 -1099   -578 tmp/globalize/date.min.js                                        
     =      = tmp/globalize/message.min.js                                     
   +36     +9 tmp/globalize/number.min.js                                      
     =      = tmp/globalize/plural.min.js                                      
     =      = tmp/globalize/relative-time.min.js                               
     =      = tmp/globalize/unit.min.js                                        
     =      = tmp/globalize-runtime.min.js                                     
     =      = tmp/globalize-runtime/currency.min.js                            
 -2034   -881 tmp/globalize-runtime/date.min.js                                
     =      = tmp/globalize-runtime/message.min.js                             
     =      = tmp/globalize-runtime/number.min.js                              
     =      = tmp/globalize-runtime/plural.min.js                              
     =      = tmp/globalize-runtime/relative-time.min.js                       
     =      = tmp/globalize-runtime/unit.min.js  
@rxaviers
Copy link
Member Author

rxaviers commented May 29, 2017

And smarter use of regular expressions, i.e., create necessary regular expression only and do it once.

@rxaviers rxaviers force-pushed the rxaviers:optimize-date-parsing branch from cbc5ede to c2e998d May 29, 2017
@rxaviers rxaviers merged commit c2e998d into globalizejs:master May 29, 2017
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
licence/cla Contributor License Agreement is signed.
Details
@rxaviers rxaviers added this to the 1.3.0 milestone May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.