Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
chore(perf): add performance
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiocro committed May 31, 2018
1 parent 92768cf commit 2b4f4a4
Show file tree
Hide file tree
Showing 33 changed files with 21,398 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/perf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
node_modules/
dist/
generate/*.json
generate/*.png
npm-debug.log
yarn-error.log

# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
45 changes: 45 additions & 0 deletions examples/perf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@


# vue-i18next -performance-comparison-example

> vue-i18next performance comparison example
This performance test are originaly from [vue-i18n](https://github.com/kazupon/vue-i18n)

## Performance measurement prepare

```sh
# setup performance comparison examples
$ npm run setup

# build performance comparison examples
$ npm run build
```

## Performance measurement

```sh
# serve perform comparison examples
$ npm run serve

# measure performance !!
$ npm run perform
```

## Performance measurement targets
- Plain: Render TODO items only (No translation)
- Method: Render TODO items with `$t` method
- Directive: Render TODO items with `v-t` custom directive
- Compile: Render TODO items with compiler module

## Measurement enviroments
- Vue.config.performance = true
- Builded `vue-cli` webpack-simple
- Development build (Disable Production build)
- Headless chrome (pappeteer)

## An approach to measurement
Render 1000 TODO items, after that remove 10 TODO items.

## Measurement items
- Re-render user timing pass time, when remove TODO item.
5 changes: 5 additions & 0 deletions examples/perf/directive/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
["env", { "modules": false }]
]
}
12 changes: 12 additions & 0 deletions examples/perf/directive/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.DS_Store
node_modules/
dist/
npm-debug.log
yarn-error.log

# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
18 changes: 18 additions & 0 deletions examples/perf/directive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# vue-i18next-with-directive

> List rendering with vue-i18n `v-t` custom directive
## Build Setup

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build
```

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
14 changes: 14 additions & 0 deletions examples/perf/directive/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>vue-i18next-with-directive</title>
</head>

<body>
<div id="app"></div>
<script src="/directive/dist/build.js"></script>
</body>

</html>
Loading

0 comments on commit 2b4f4a4

Please sign in to comment.