2015-09-08

Query for Student Transcript (and Cumulative GPA)

There are some rules to generate transcript, some universities will use bet the highest grade, but some other will use get the latest grade. For example if we have this schema

CREATE TABLE schedules (
  id BIGSERIAL PRIMARY KEY,
  subject_id BIGINT FOREIGN KEY REFERENCES subjects(id),
  semester VARCHAR(5) -- YYYYS -- year and semester
);
CREATE TABLE enrollments (
  id BIGSERIAL PRIMARY KEY,
  student_id BIGINT FOREIGN KEY REFERENCES students(id),
  schedule_id BIGINT FOREIGN KEY REFERENCES schedules(id),
  grade VARCHAR(2) -- letter
);

If the university rule for transcript is get the highest score, the query is quite simple, first you'll need to make sure that grade is ordered in certain way on MAX agregate (for example: A+ > A > A- > B+ > ...) , then you'll need to do this query:

SELECT s.subject_id
  , MAX(e.grade)
FROM enrollments e
  JOIN schedules s
    ON e.schedule_id = s.id
WHERE e.student_id = ?
GROUP BY 1

If the university rules is get the latest score, first of all, you'll need to make sure that the semester is ordered (for example: 2015A < 2015B < 2015C < 2015A < ...), then you'll need to find the latest semester of each subject, for example:

SELECT s.subject_id
  , MAX(s.semester)
FROM enrollments e
  JOIN schedules s
    ON e.schedule_id = s.id
WHERE e.student_id = ?
GROUP BY 1

Then you'll need to fetch the credits that is the latest semester, for example:

SELECT s.subject_id
  , e.grade
FROM enrollments e
  JOIN schedules s
    ON e.schedule_id = s.id
WHERE e.student_id = ?
  AND (s.subject_id, s.semester) IN
    ( SELECT s.subject_id
        , MAX(s.semester)
      FROM enrollments e
        JOIN schedules s
          ON e.schedule_id = s.id
      WHERE e.student_id = ?
      GROUP BY 1
    )
GROUP BY 1

That way, it you'll only get the latest grade (as defined on the sub-query).

There are another alternative for this, you can use aggregate with OVER and PARTITION BY syntax, then compare the result with the aggregate to remove the previous scores, for example:

SELECT r.subject_id
  , r.grade
FROM (
  SELECT s.subject_id
    , e.grade
    , s.semester
    , MAX(s.semester) OVER (PARTITION BY s.subject_id) max_sem
  FROM enrollments e
    JOIN schedules s
      ON e.schedule_id = s.id
  WHERE e.student_id = ?) r
WHERE r.semester_id = r.max_sem

That's it, that's the way to get the transcript. Those queries can be modified to fetch the Cumulative GPA. just add one more join with subjects table to get the units/credits, then just calculate the SUM(subjects.unit * enrollments.num_grade) / SUM(subjects.unit)
You can also calculate the Cumulative GPA per semester by adding the semester for the partition/group by part. If you wonder, why do I write this post? because I have googled and not found any posts that write about this.

2015-08-24

Go 1.5 Compile Speed

Go 1.5 has been released few days ago, today we will measure the compile speed of Go application. The source code for the measurement is around 36K lines (1.39 MB).

$ alias time
alias time='/usr/bin/time -f "\nCPU: %Us\tReal: %es\tRAM: %MKB"'

# Quad core i7 4700MQ, 16GB RAM, Linux 4.1.5 x86_64

# go version go1.3.3 linux/amd64
CPU: 4.39s Real: 2.54s RAM: 202944KB
CPU: 4.34s Real: 2.57s RAM: 202840KB
CPU: 4.47s Real: 2.60s RAM: 202844KB

# go version go1.4.2 linux/amd64
CPU: 4.23s Real: 2.39s RAM: 204656KB
CPU: 4.20s Real: 2.41s RAM: 204660KB
CPU: 4.71s Real: 2.81s RAM: 204624KB

# go version go1.5 linux/amd64
CPU: 17.09s Real: 6.35s RAM: 198416KB
CPU: 17.36s Real: 6.41s RAM: 198308KB
CPU: 17.35s Real: 6.21s RAM: 198000KB


The compile speed as stated on their mailing list, becomes significantly slower, I guess, I'll stick with 1.4 branch until 1.7 ready.

2015-08-21

How to Install Go 1.5 on Windows 10

This tutorial will show you how to install Go 1.5 (but why?) on Windows 10. First of all you'll need to open your browser and go to http://golang.org

Click on the "Download Go" button, it will redirect to another page:

Click on the "Microsoft Windows" button, it will download an .msi file. After the download complete, run the file.

Click "Run": 

Click "Next", "Next", and so on until installed:

After finished, click the start menu, type "computer", right click on "This PC", choose "Properties":

Then choose "Advanced system settings", "Environment Variables..", click "New" on "user variables" panel.

Set the "GOPATH" to "%HOMEDRIVE%%HOMEPATH%\Documents\go" or anywhere else for your main go directory, something like this:

Click "OK" on all dialog, next, just open a "Command Prompt" window and create required directory, type 

go version
:: go version go1.5 windows/amd64
mkdir Documents\go\src
:: creating a directory, only required for the first time
cd Documents\go\src
:: change directory to %GOPATH%\src
notepad hello.go
:: edit a new source code

Create a new source code and type something like this:

package main
import `fmt`
func main() {
  fmt.Println( `Hello from Indonesia~ 1+1 =`, 1+1 )
}

Save, then go back to command prompt, type:

go run hello.go

A line will printed, and that's how you could install and run a example go program.
For more resources on how to learn programming in Go, please refer to the documentation (that can be viewed offline also, search for "GoDocServer" on the start menu.

There are some recommended IDE:
  1. IntelliJ IDEA with go-lang-idea-plugins
  2. LiteIDE (no-cost)
  3. Atom with go-plus (no-cost)
  4. Sublime Text with GoSublime
  5. Wide (no-cost)
  6. ZeusEdit
  7. KomodoIDE
  8. Eclipse PDE with GoClipse (no-cost)
That's it~ Btw how many "go" words in this article? 

2015-08-14

Moving PostgreSQL Database to RAM

If you are software developer, sometimes you need to test your program faster. Normally the bottleneck of your program are in the database (writing to disk). You can increase the performance of your development/testing, by moving the database to the RAM if you have enough free RAM (>3GB). In this article, I will guide you to move your PostgreSQL database to RAM. First of all, you'll need to stop and disable the PostgreSQL, so the port won't conflict:

sudo systemctl stop postgresql
sudo systemctl disable postgresql

As we already know, /tmp folder on Linux mostly use tmpfs, that is a RAM file system. So if we create the database on the /tmp directory, it's on the RAM. What you'll need to do is create a script containing something like this:

#!/usr/bin/env bash
sudo killall postgres
# init directories
src=/tmp/data
sudo rm -rf $src
mkdir -p $src
sudo chown postgres:postgres $src
sudo su - postgres <<EOF
initdb --locale en_CA.UTF-8 -E UTF8 -D '/tmp/data'
sed -i -- 's/max_connections = 100/max_connections = 1024/' /tmp/data/postgresql.conf
sed -i -- 's/#logging_collector = off/logging_collector = on/' /tmp/data/postgresql.conf
sed -i -- "s/#log_directory = 'pg_log'/log_directory = '\/tmp'/" /tmp/data/postgresql.conf
sed -i -- "s/#log_file_mode = 0600/log_file_mode = 0644/" /tmp/data/postgresql.conf
sed -i -- "s/#log_min_duration_statement = -1/log_min_duration_statement = 0/" /tmp/data/postgresql.conf
sed -i -- "s/#log_error_verbosity = default/log_error_verbosity = verbose/" /tmp/data/postgresql.conf
sed -i -- "s/#log_statement = 'none'/log_statement = 'all'/" /tmp/data/postgresql.conf
# sed -i -- "s///" /tmp/data/postgresql.conf
postgres -D /tmp/data &
echo sleep 2 seconds..
sleep 2
createuser xxx
createdb xxx
psql -c 'GRANT ALL PRIVILEGES ON DATABASE xxx TO xxx;'
echo you can restore database now..
EOF

This script will erase all your database and create a new empty database on the RAM, that you can restore into later. This script will also create a log file that shows all queries that could help on the softwade development process. Lastly, to measure your PostgreSQL's data directory size in MB you can type this command:

$ sudo du -s -B 1M /tmp/data/
336     /tmp/data/

That's it, as a measurement, to restore a 137 MB database (about 300k records) in my PC normally it took about 17 seconds, when the database moved to RAM, it only took 5 seconds, so yes, it's a huge improvement.

2015-07-19

Tilde terminal/console text editor, a vim alternative

I've been working with windows since 4th grade, and I know that learning vim is not easy, as there so many shortcuts to remember. I've read vimtutor 3 times, but still I could not remember the command for find-replace words (I must google it again and again, is it :%s/needle/gold/g or something)  For beginner I found that tilde is one of the best out there, you can install on ArchLinux by typing:

yaourt --needed --noconfirm -S --force tilde

The user interface much like DOS' edit (or Turbo C++), and the shortcut works as expected as in Windows' notepad (shift+arrow to highlight, ctrl+Z undo, ctrl+Y redo, ctrl+C to copy, ctrl+V to paste, ctrl+X to cut, ctrl+F to search, F3 to find next, ctrl+R to replace, ctrl+Q to quit). It also have basic syntax highlighting.


Another alternative would be diakonos (requires Ruby) and sanos editor (only one source code, requires C compiler).

2015-07-17

Atom vs Brackets vs LightTable vs Zed

Today we will review about some text editor that seems to be gaining popularity lately, that are Atom (Github), Brackets (Adobe), LightTable and Zed. To install them on ArchLinux, just type:

yaourt --needed --noconfirm -S --force brackets-bin atom-editor-bin lighttable zed slap

First one is Atom 1.0.2-1, it uses 131MB of RAM at the first run, the Javascript autocomplete seems not working.


The second one is Brackets 1.3-1, it uses 75MB of RAM at the first run, the Javascript autocomplete works fine.


The third one is LightTable 0.7.2-1, it uses 70MB of RAM at the first run, the Javascript autocomplete not as good as Bracket's..


The fourth one is Zed 1.1.0-1, it uses 54MB of RAM at the first run, there are no built-in Javascript autocomplete.


Bonus: Slap is terminal-based text-editor that aims to be similar to SublimeText. It uses 101MB of RAM at the first run, and the key shortcut (PgUp, PgDn, Up, Down) seems not working well. LimeText (currently broken: lime-git) also tried to be SublimeText clone.

The winner for now would be Brackets..

2015-07-12

Go 1.4.2 vs 1.5 beta 1 Benchmark

Go 1.5 beta 1 has been released few days ago, this go version has no longer need a C compiler. Today we will compare the performance between latest stable (1.4.2) and this version using a modified autobench (since Go no longer use hg).

# go1
benchmark                          old ns/op      new ns/op      delta
BenchmarkBinaryTree17              3610434929     3617991624     +0.21%
BenchmarkFannkuch11                3209701868     3245042703     +1.10%
BenchmarkFmtFprintfEmpty           88.3           87.3           -1.13%
BenchmarkFmtFprintfString          248            241            -2.82%
BenchmarkFmtFprintfInt             247            240            -2.83%
BenchmarkFmtFprintfIntInt          377            367            -2.65%
BenchmarkFmtFprintfPrefixedInt     342            331            -3.22%
BenchmarkFmtFprintfFloat           432            425            -1.62%
BenchmarkFmtManyArgs               1488           1499           +0.74%
BenchmarkGobDecode                 11965020       11985801       +0.17%
BenchmarkGobEncode                 10418308       10550859       +1.27%
BenchmarkGzip                      498284535      505437209      +1.44%
BenchmarkGunzip                    108602561      108527595      -0.07%
BenchmarkHTTPClientServer          46047          45537          -1.11%
BenchmarkJSONEncode                25542781       25169571       -1.46%
BenchmarkJSONDecode                82805313       82857212       +0.06%
BenchmarkMandelbrot200             4450288        4448470        -0.04%
BenchmarkGoParse                   4887710        4869301        -0.38%
BenchmarkRegexpMatchEasy0_32       160            159            -0.62%
BenchmarkRegexpMatchEasy0_1K       403            404            +0.25%
BenchmarkRegexpMatchEasy1_32       147            147            +0.00%
BenchmarkRegexpMatchEasy1_1K       1056           1051           -0.47%
BenchmarkRegexpMatchMedium_32      249            257            +3.21%
BenchmarkRegexpMatchMedium_1K      84432          83958          -0.56%
BenchmarkRegexpMatchHard_32        4155           4235           +1.93%
BenchmarkRegexpMatchHard_1K        130382         132217         +1.41%
BenchmarkRevcomp                   740884366      747985110      +0.96%
BenchmarkTemplate                  111190621      112358819      +1.05%
BenchmarkTimeParse                 441            439            -0.45%
BenchmarkTimeFormat                410            411            +0.24%

benchmark                         old MB/s     new MB/s     speedup
BenchmarkGobDecode                64.15        64.04        1.00x
BenchmarkGobEncode                73.67        72.75        0.99x
BenchmarkGzip                     38.94        38.39        0.99x
BenchmarkGunzip                   178.68       178.80       1.00x
BenchmarkJSONEncode               75.97        77.10        1.01x
BenchmarkJSONDecode               23.43        23.42        1.00x
BenchmarkGoParse                  11.85        11.90        1.00x
BenchmarkRegexpMatchEasy0_32      198.92       200.52       1.01x
BenchmarkRegexpMatchEasy0_1K      2537.48      2531.14      1.00x
BenchmarkRegexpMatchEasy1_32      216.75       216.22       1.00x
BenchmarkRegexpMatchEasy1_1K      969.37       974.15       1.00x
BenchmarkRegexpMatchMedium_32     4.01         3.88         0.97x
BenchmarkRegexpMatchMedium_1K     12.13        12.20        1.01x
BenchmarkRegexpMatchHard_32       7.70         7.56         0.98x
BenchmarkRegexpMatchHard_1K       7.85         7.74         0.99x
BenchmarkRevcomp                  343.06       339.80       0.99x
BenchmarkTemplate                 17.45        17.27        0.99x

# runtime
benchmark                                 old ns/op     new ns/op     delta
BenchmarkAppend                           32.3          32.5          +0.62%
BenchmarkAppend1Byte                      111           109           -1.80%
BenchmarkAppend4Bytes                     111           108           -2.70%
BenchmarkAppend8Bytes                     112           110           -1.79%
BenchmarkAppend16Bytes                    118           118           +0.00%
BenchmarkAppend32Bytes                    125           119           -4.80%
BenchmarkAppendSpecialCase                28.0          28.0          +0.00%
BenchmarkSelectUncontended                277           252           -9.03%
BenchmarkSelectContended                  279           264           -5.38%
BenchmarkSelectNonblock                   36.1          36.2          +0.28%
BenchmarkChanUncontended                  94.7          91.6          -3.27%
BenchmarkChanContended                    94.8          91.5          -3.48%
BenchmarkChanSync                         320           313           -2.19%
BenchmarkChanProdCons0                    311           313           +0.64%
BenchmarkChanProdCons10                   153           150           -1.96%
BenchmarkChanProdCons100                  104           104           +0.00%
BenchmarkChanProdConsWork0                774           772           -0.26%
BenchmarkChanProdConsWork10               580           583           +0.52%
BenchmarkChanProdConsWork100              532           533           +0.19%
BenchmarkChanCreation                     386           390           +1.04%
BenchmarkChanSem                          101           104           +2.97%
BenchmarkCallClosure                      4.11          4.13          +0.49%
BenchmarkCallClosure1                     4.67          4.68          +0.21%
BenchmarkCallClosure2                     49.7          49.8          +0.20%
BenchmarkCallClosure3                     50.5          50.4          -0.20%
BenchmarkCallClosure4                     52.2          50.8          -2.68%
BenchmarkComplex128DivNormal              30.0          29.7          -1.00%
BenchmarkComplex128DivNisNaN              15.3          15.0          -1.96%
BenchmarkComplex128DivDisNaN              15.5          15.5          +0.00%
BenchmarkComplex128DivNisInf              12.3          12.2          -0.81%
BenchmarkComplex128DivDisInf              11.4          11.0          -3.51%
BenchmarkConvT2ESmall                     41.8          39.8          -4.78%
BenchmarkConvT2EUintptr                   58.8          56.6          -3.74%
BenchmarkConvT2ELarge                     82.9          79.6          -3.98%
BenchmarkConvT2ISmall                     44.9          42.5          -5.35%
BenchmarkConvT2IUintptr                   60.7          60.4          -0.49%
BenchmarkConvT2ILarge                     81.8          82.1          +0.37%
BenchmarkConvI2E                          19.6          20.5          +4.59%
BenchmarkConvI2I                          26.6          26.8          +0.75%
BenchmarkAssertE2T                        10.7          10.6          -0.93%
BenchmarkAssertE2TLarge                   8.02          7.79          -2.87%
BenchmarkAssertE2I                        27.1          26.8          -1.11%
BenchmarkAssertI2T                        10.7          10.7          +0.00%
BenchmarkAssertI2I                        27.1          27.0          -0.37%
BenchmarkAssertI2E                        12.5          12.7          +1.60%
BenchmarkAssertE2E                        2.85          2.95          +3.51%
BenchmarkMalloc8                          40.8          40.8          +0.00%
BenchmarkMalloc16                         62.4          62.7          +0.48%
BenchmarkMallocTypeInfo8                  49.9          51.8          +3.81%
BenchmarkMallocTypeInfo16                 68.9          70.1          +1.74%
BenchmarkHashStringSpeed                  32.2          31.7          -1.55%
BenchmarkHashInt32Speed                   21.7          22.9          +5.53%
BenchmarkHashInt64Speed                   22.6          20.9          -7.52%
BenchmarkHashStringArraySpeed             89.5          89.4          -0.11%
BenchmarkMegMap                           21.9          21.8          -0.46%
BenchmarkMegOneMap                        14.5          14.3          -1.38%
BenchmarkMegEqMap                         135441        151242        +11.67%
BenchmarkMegEmptyMap                      4.62          4.43          -4.11%
BenchmarkSmallStrMap                      24.0          22.5          -6.25%
BenchmarkMapStringKeysEight_16            26.3          25.8          -1.90%
BenchmarkMapStringKeysEight_32            24.1          24.0          -0.41%
BenchmarkMapStringKeysEight_64            24.1          23.8          -1.24%
BenchmarkMapStringKeysEight_1M            24.6          24.1          -2.03%
BenchmarkIntMap                           13.8          13.7          -0.72%
BenchmarkRepeatedLookupStrMapKey32        37.5          37.7          +0.53%
BenchmarkRepeatedLookupStrMapKey1M        289799        288667        -0.39%
BenchmarkNewEmptyMap                      176           179           +1.70%
BenchmarkMemmove32                        4.97          4.96          -0.20%
BenchmarkMemmove4K                        125           129           +3.20%
BenchmarkMemmove64K                       4212          4201          -0.26%
BenchmarkMemmove4M                        1220753       1214904       -0.48%
BenchmarkMemmove64M                       23136165      23164164      +0.12%
BenchmarkFinalizer                        1983          2134          +7.61%
BenchmarkFinalizerRun                     2950          3400          +15.25%
BenchmarkStackGrowth                      1067          1047          -1.87%
BenchmarkStackGrowthDeep                  98836         99200         +0.37%
BenchmarkCreateGoroutines                 165           173           +4.85%
BenchmarkCreateGoroutinesParallel         163           173           +6.13%
BenchmarkMatmult                          11.7          11.7          +0.00%
BenchmarkIfaceCmp100                      152           152           +0.00%
BenchmarkIfaceCmpNil100                   151           151           +0.00%
BenchmarkDefer                            113           116           +2.65%
BenchmarkDefer10                          109           109           +0.00%
BenchmarkDeferMany                        197           198           +0.51%
BenchmarkCompareStringEqual               6.78          7.04          +3.83%
BenchmarkCompareStringIdentical           3.31          3.30          -0.30%
BenchmarkCompareStringSameLength          5.60          5.70          +1.79%
BenchmarkCompareStringDifferentLength     1.46          1.45          -0.68%
BenchmarkCompareStringBigUnaligned        171884        158067        -8.04%
BenchmarkCompareStringBig                 160824        173059        +7.61%

benchmark                              old MB/s     new MB/s     speedup
BenchmarkMemmove32                     6433.46      6448.92      1.00x
BenchmarkMemmove4K                     32649.50     31615.57     0.97x
BenchmarkMemmove64K                    15557.25     15598.08     1.00x
BenchmarkMemmove4M                     3435.83      3452.37      1.00x
BenchmarkMemmove64M                    2900.60      2897.10      1.00x
BenchmarkCompareStringBigUnaligned     6100.52      6633.79      1.09x
BenchmarkCompareStringBig              6520.08      6059.11      0.93x

# http
benchmark                                    old ns/op     new ns/op     delta
BenchmarkHeaderWriteSubset                   1089          1102          +1.19%
BenchmarkReadRequestChrome                   7632          7816          +2.41%
BenchmarkReadRequestCurl                     4117          4187          +1.70%
BenchmarkReadRequestApachebench              4174          4235          +1.46%
BenchmarkReadRequestSiege                    5413          5559          +2.70%
BenchmarkReadRequestWrk                      3251          3259          +0.25%
BenchmarkClientServer                        57029         58670         +2.88%
BenchmarkClientServerParallel4               53481         53415         -0.12%
BenchmarkClientServerParallel64              57987         58825         +1.45%
BenchmarkServer                              94721         90171         -4.80%
BenchmarkServerFakeConnNoKeepAlive           20102         20171         +0.34%
BenchmarkServerFakeConnWithKeepAlive         11940         11869         -0.59%
BenchmarkServerFakeConnWithKeepAliveLite     7163          7216          +0.74%
BenchmarkServerHandlerTypeLen                10001         9789          -2.12%
BenchmarkServerHandlerNoLen                  9119          9239          +1.32%
BenchmarkServerHandlerNoType                 9537          9491          -0.48%
BenchmarkServerHandlerNoHeader               6836          6797          -0.57%

benchmark                           old MB/s     new MB/s     speedup
BenchmarkReadRequestChrome          80.05        78.16        0.98x
BenchmarkReadRequestCurl            18.94        18.62        0.98x
BenchmarkReadRequestApachebench     19.64        19.36        0.99x
BenchmarkReadRequestSiege           27.89        27.16        0.97x
BenchmarkReadRequestWrk             12.30        12.27        1.00x

# floats
benchmark                   old ns/op     new ns/op     delta
BenchmarkMinSmall           14.8          10.3          -30.41%
BenchmarkMinMed             1061          1060          -0.09%
BenchmarkMinLarge           98087         97484         -0.61%
BenchmarkMinHuge            14173118      12924135      -8.81%
BenchmarkAddTwoSmall        20.4          19.7          -3.43%
BenchmarkAddFourSmall       42.2          44.1          +4.50%
BenchmarkAddTwoMed          1165          1178          +1.12%
BenchmarkAddFourMed         3811          3864          +1.39%
BenchmarkAddTwoLarge        142145        126961        -10.68%
BenchmarkAddFourLarge       450354        444121        -1.38%
BenchmarkAddTwoHuge         24374925      24886854      +2.10%
BenchmarkAddFourHuge        72174829      72954174      +1.08%
BenchmarkLogSumExpSmall     326           326           +0.00%
BenchmarkLogSumExpMed       25215         25133         -0.33%
BenchmarkLogSumExpLarge     2515656       2501928       -0.55%
BenchmarkLogSumExpHuge      252999542     252223655     -0.31%
BenchmarkDotSmall           16.9          17.0          +0.59%
BenchmarkDotMed             1267          1288          +1.66%
BenchmarkDotLarge           138638        128113        -7.59%
BenchmarkDotHuge            18019736      17245628      -4.30%

# cipher
benchmark                  old ns/op     new ns/op     delta
BenchmarkAESCFBEncrypt     4111          4094          -0.41%
BenchmarkAESCFBDecrypt     4158          4158          +0.00%
BenchmarkAESOFB            2955          2948          -0.24%
BenchmarkAESCTR            2802          2805          +0.11%
BenchmarkAESCBCEncrypt     3631          3639          +0.22%
BenchmarkAESCBCDecrypt     3476          3479          +0.09%

benchmark                  old MB/s     new MB/s     speedup
BenchmarkAESCFBEncrypt     248.80       249.82       1.00x
BenchmarkAESCFBDecrypt     246.03       245.99       1.00x
BenchmarkAESOFB            346.10       346.93       1.00x
BenchmarkAESCTR            365.02       364.59       1.00x
BenchmarkAESCBCEncrypt     281.99       281.38       1.00x
BenchmarkAESCBCDecrypt     294.58       294.28       1.00x

# megajson
benchmark                old ns/op     new ns/op     delta
BenchmarkCodeEncoder     13785446      13900456      +0.83%
BenchmarkCodeDecoder     52564639      53406965      +1.60%

benchmark                old MB/s     new MB/s     speedup
BenchmarkCodeEncoder     140.76       139.60       0.99x
BenchmarkCodeDecoder     36.92        36.33        0.98x

# goquery
benchmark                                  old ns/op     new ns/op     delta
BenchmarkFirst                             120           120           +0.00%
BenchmarkLast                              122           122           +0.00%
BenchmarkEq                                120           120           +0.00%
BenchmarkSlice                             119           116           -2.52%
BenchmarkGet                               2.08          2.15          +3.37%
BenchmarkIndex                             967           962           -0.52%
BenchmarkIndexSelector                     17078         17284         +1.21%
BenchmarkIndexOfNode                       7.76          8.48          +9.28%
BenchmarkIndexOfSelection                  9.00          9.08          +0.89%
BenchmarkMetalReviewExample                199050        199007        -0.02%
BenchmarkAdd                               14866         14914         +0.32%
BenchmarkAddSelection                      242           239           -1.24%
BenchmarkAddNodes                          240           250           +4.17%
BenchmarkAndSelf                           3422          3369          -1.55%
BenchmarkFilter                            26705         27108         +1.51%
BenchmarkNot                               30674         29978         -2.27%
BenchmarkFilterFunction                    73936         72230         -2.31%
BenchmarkNotFunction                       91468         83512         -8.70%
BenchmarkFilterNodes                       68995         67968         -1.49%
BenchmarkNotNodes                          102695        92672         -9.76%
BenchmarkFilterSelection                   70045         68360         -2.41%
BenchmarkNotSelection                      92015         89317         -2.93%
BenchmarkHas                               349779        346900        -0.82%
BenchmarkHasNodes                          258847        258919        +0.03%
BenchmarkHasSelection                      259034        262826        +1.46%
BenchmarkEnd                               3.70          3.70          +0.00%
BenchmarkEach                              10426         10668         +2.32%
BenchmarkMap                               17731         17425         -1.73%
BenchmarkEachWithBreak                     1772          1754          -1.02%
BenchmarkAttr                              29.3          29.8          +1.71%
BenchmarkText                              21126         21657         +2.51%
BenchmarkLength                            0.50          0.50          +0.00%
BenchmarkHtml                              700           702           +0.29%
BenchmarkIs                                29651         29724         +0.25%
BenchmarkIsPositional                      25168         24981         -0.74%
BenchmarkIsFunction                        2624          2537          -3.32%
BenchmarkIsSelection                       70886         71044         +0.22%
BenchmarkIsNodes                           69937         70392         +0.65%
BenchmarkHasClass                          492075        503152        +2.25%
BenchmarkContains                          10.3          10.2          -0.97%
BenchmarkFind                              18310         18347         +0.20%
BenchmarkFindWithinSelection               52644         53080         +0.83%
BenchmarkFindSelection                     385889        387872        +0.51%
BenchmarkFindNodes                         387584        387242        -0.09%
BenchmarkContents                          3092          3108          +0.52%
BenchmarkContentsFiltered                  4618          4664          +1.00%
BenchmarkChildren                          573           574           +0.17%
BenchmarkChildrenFiltered                  3355          3362          +0.21%
BenchmarkParent                            39884         40015         +0.33%
BenchmarkParentFiltered                    42579         42476         -0.24%
BenchmarkParents                           102337        102029        -0.30%
BenchmarkParentsFiltered                   105241        106218        +0.93%
BenchmarkParentsUntil                      43303         43504         +0.46%
BenchmarkParentsUntilSelection             181515        182529        +0.56%
BenchmarkParentsUntilNodes                 182841        181004        -1.00%
BenchmarkParentsFilteredUntil              10296         10264         -0.31%
BenchmarkParentsFilteredUntilSelection     22491         22941         +2.00%
BenchmarkParentsFilteredUntilNodes         22643         23972         +5.87%
BenchmarkSiblings                          91080         92089         +1.11%
BenchmarkSiblingsFiltered                  98516         98892         +0.38%
BenchmarkNext                              10475         10508         +0.32%
BenchmarkNextFiltered                      12498         12513         +0.12%
BenchmarkNextAll                           60468         61451         +1.63%
BenchmarkNextAllFiltered                   65379         65870         +0.75%
BenchmarkPrev                              10520         10595         +0.71%
BenchmarkPrevFiltered                      12554         12757         +1.62%
BenchmarkPrevAll                           18925         19141         +1.14%
BenchmarkPrevAllFiltered                   21208         21440         +1.09%
BenchmarkNextUntil                         44017         44662         +1.47%
BenchmarkNextUntilSelection                68729         68919         +0.28%
BenchmarkNextUntilNodes                    27943         28107         +0.59%
BenchmarkPrevUntil                         126734        128276        +1.22%
BenchmarkPrevUntilSelection                88316         88584         +0.30%
BenchmarkPrevUntilNodes                    21776         21868         +0.42%
BenchmarkNextFilteredUntil                 35019         34948         -0.20%
BenchmarkNextFilteredUntilSelection        76520         76185         -0.44%
BenchmarkNextFilteredUntilNodes            77361         76279         -1.40%
BenchmarkPrevFilteredUntil                 39433         35690         -9.49%
BenchmarkPrevFilteredUntilSelection        89674         79287         -11.58%
BenchmarkPrevFilteredUntilNodes            82300         79039         -3.96%
BenchmarkClosest                           4916          4777          -2.83%
BenchmarkClosestSelection                  683           683           +0.00%
BenchmarkClosestNodes                      679           680           +0.15%

I somehow failed to get the snappy benchmark code. There are no really major performance changes.