jing js (一)

Info

这次lyk同学北上,参加 jingjs ,我托lyk童鞋的福,也去jing js打了次酱油。

以下是本次大会两天议程的简要笔记。

A Better World for node.js

Debug

node-inspector

1
slc debug blog

Performance

strongOps

First sign up to get app key.

1
slc strongops [options]

Bitcoin

Coinpunk

open source bitcoin wallet

We cannot put key in web server.

Move bitcoin key to brower

Libraries

1
2
3
4
5
6
 - Cryptojs
 - SJCL
 - JSBN
 - BigNumber.js
 - BitcoinJS-LIB
 - RandJS

My year with Node.js

1
code + tests + documentation = module
1
2
3
4
5
 - code
  - implementation
  - interfaces
 - test
 - documentation
1
Everything is a module, once finish, you can open source
1
2
Service is  provided  by modules
System  is  provided  by services

Substack

run

1
2
3
4
5
6
7
8
curl http://192.168.1.129:5000/modules.tar.gz | tar xz
Inside you will find 3 adventures:
learnyounode - learn the basics of node
stream-adventure - learn you to use streams in node
levelmeup - learn the basics of leveldb
To run an adventure, do `npm run $ADVENTURE` like this:
npm run stream-adventure
To run the leveldb adventures, you will need to run `npm rebuild` to rebuild the leveldb bindings for your platform if you're not running x64 linux.

level db

cities1000

CPUJS

用户端CPU性能监控

  • 通过执行时间来衡量, 超过100ms 就感觉很慢, 所以把100ms当成顶峰。
  • 卡的占比 LTP(Lag Time Percentage)

任务式编程调度

  • one task = one function or one function includes a lot of functions.
1
   CPUJS.load(foo());

Task Manager

  • Loading tasks
  • Killing tasks

Zero to Ready With Geddy

Geddy

  • Start server
  • Generators
  • Run jake

On BigPipe On Node.js

On Bigpipe

1
Improve web page loading performance by facebook
  • Chunked Encoding
    • content length vs chunked encoding ?
    • chunked encoding don't need write content length, just use res.write
  • Zoom in Bussiness Logic part
    • every part have different time to gernerate.
    • But Chunked Encoding cannot transfer part by part.
  • Bigpipe
    • bigpipe can do this.
    • browser use javascript to show page by Chunked Encoding
  • Why node for Bigpipe?
    • HTML generate by Front developer.

Pemelo...Untitled

What?

  • game server framework
  • Realtime users online game

Framework

  • Abstract servers
  • Abstract request/response and broadcast/push
  • rpc framework

Evolution

  • Pemelo connector
  • Message compress
  • Reliability
    • Zookeeper
  • New features
    • Plugin mechanism
    • Crontab & Filter

Message push platform

  • long connection
  • Use
    • Baidu
    • SNDA
    • jpush
    • getui
  • Framework
    • Zookeeper
    • Redis
    • MQTT
    • Socket IO
  • Broadcast Message
    • Create channel
    • Filter clients
  • Multiplex link
    • Share one link with push-server
  • Tips
    • remeber bind cpu

Data Visualization

junk charts

Lying

1
2
  - size of effect of show data
  - pie is bad for you

what can we do?

1
2
  - less is more
  - use a table

Modern tools

1
2
3
4
5
  - d3
  - Canvas vs SVG
  - Interactivity
  - Extensibility
   - Google Charts

tips

1
2
  - indeed
  - find job