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

Replace CoffeeScript block into JavaScript in Views. #9819

Merged
merged 1 commit into from Nov 10, 2015
Merged

Replace CoffeeScript block into JavaScript in Views. #9819

merged 1 commit into from Nov 10, 2015

Conversation

huacnlee
Copy link
Contributor

Use CoffeeScript in View will compile again and again in each requests, because there have variables, Rails view can't caching them.

:coffeescript
  projectId = #{@project.id}

By my benchmark test for shared/issuable/_context render time:

  • CoffeeScript: 190ms
  • JavaScript: 19.7ms

I have enabled all caching config like production environment.

For example view: shared/issuable/_context

CoffeeScript: 190ms
JavaScript: 19.7ms
@stanhu
Copy link
Member

stanhu commented Nov 10, 2015

Fascinating.

/cc: @randx

@dzaporozhets
Copy link
Member

Use CoffeeScript in View will compile again and again in each requests, because there have variables, Rails view can't caching them.

Wow thats amazing. I did not know that.

@dzaporozhets
Copy link
Member

Especially benchmarks numbers are big

dzaporozhets added a commit that referenced this pull request Nov 10, 2015
Replace CoffeeScript block into JavaScript in Views.
@dzaporozhets dzaporozhets merged commit 316dd9c into gitlabhq:master Nov 10, 2015
@huacnlee huacnlee deleted the do-not-use-coffeescript-in-view branch November 11, 2015 02:15
@fengmk2
Copy link

fengmk2 commented Nov 13, 2015

👍

@cloudwater
Copy link

awesome!

dzaporozhets pushed a commit that referenced this pull request Jan 14, 2016
* master: (143 commits)
  Only load autocomplete data when actually needed
  Check for current user
  Add pencil icon to edit group settings
  Issue #5817 wording of the web hooks updated on issue and merge events
  use JavaScript instead of CoffeeScript in Views, the reason #9819
  Before project save ensure that a runners_token exists
  Fix Error 500 when visiting build page of project with nil runners_token
  Remove outdated gitlab-git-http-server reference from Install doc
  Fix typo in build page of projects
  Update docs for shared runner default settings
  Disable "Already Blocked" button in admin abuse report page
  Add CHANGELOG entry for reply-by-email fix
  Use WOFF versions of SourceSansPro
  Clean up document on adding users to a project
  Refactor ZenMode
  Fix caching issue where build status was not updating in project dashboard
  Add a CHANGELOG entry for The Most Important Feature of All Time(TM)
  changes verb `references` to noun `reference`.
  fixes new branch button positioning, when visible and not visible container
  DRY up upload and download services
  ...
@pmq20
Copy link
Contributor

pmq20 commented Jan 15, 2016

Saves 10x time. Fascinating!

@honglyua
Copy link

honglyua commented Mar 4, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants