Category Archives: Julia

WordPress to Jekyll: A 30x Speedup

By: randyzwitch - Articles

Re-posted from: http://randyzwitch.com/wordpress-jekyll-30x-speedup/

About a month ago, I switched this blog from WordPress hosted on Bluehost to Jekyll on GitHub Pages. I suspected moving to a static website would be faster than generated HTML via PHP, and it is certainly cheaper (GitHub Pages is “free”). But it wasn’t until I needed a dataset for doing some dataset visualization development that I realize how much of an improvement it has been!

Packages, Packages, Packages

With the release of v0.5 of Julia, I’ve been working (less) on updating my packages and making new packages (more), because making new stuff is more fun than maintaining old stuff! One of the packages I’ve been building is for the ECharts visualization library (v3) from Baidu. While Julia doesn’t necessarily need another visualization library, visualization is something I’m interested in and learning is easier when you’re solving problems you like. And since the world doesn’t need another Iris example, I decided to share some real world website performance data 🙂

Line Chart

One of the first features I developed for ECharts.jl was X-Y charts, which I posit is the most common chart type in business. One thing that is great about the underlying ECharts JavaScript library is that interactivity is really easy to achieve:

using ECharts, DataFrames

#Read in data
df = readtable("/assets/data/website_time_data.csv")

#Make data two different series that overlap, so endpoint touches
df[:pre] = [(x[1] <= "2016-09-06" ? x[2] : nothing) for x in zip(df[:date], df[:loadtime_ms])]
df[:post] = [(x[1] >= "2016-09-06" ? x[2] : nothing) for x in zip(df[:date], df[:loadtime_ms])]

#Graph code
l = line(df[:date], hcat(df[:pre], df[:post]))
l.ec_width = 800
seriesnames!(l, ["loadtime_ms", "post"])
colorscheme!(l, palette = ("acw", "FlatUI"))
yAxis!(l, name = "Load time in ms")
title!(l, text = "randyzwitch.com",
          subtext = "Switching from WordPress on Bluehost to Jekyll on GitHub (2016/09/06)")
toolbox!(l, chartTypes = ["bar", "line"])
slider!(l)

Even though I switched to Jekyll on WordPress on 9/6/2016, it appears that the page cache for Google Webmaster Tools didn’t really expire until 9/12/2016 or so. At the average case, the load time went from 1128ms to 38ms! Of course, this isn’t really a fair comparison, as presumably GitHub Pages runs on much better hardware than the cheap Bluehost hosting I have, and I didn’t reimplement most of the garbage I had on the WordPress version of the blog. But from a user-experience standpoint, good lord what an improvement!

Box Plots

Want to test out further functionality, here are some box plots of the load time variation:

using ECharts, DataFrames

#Read in data
df = readtable("/Users/randyzwitch/Desktop/website_load_time.csv")
df[:pre] = [(x[1] <= "2016-09-06" ? x[2] : nothing) for x in zip(df[:date], df[:loadtime_ms])]
df[:post] = [(x[1] >= "2016-09-12" ? x[2] : nothing) for x in zip(df[:date], df[:loadtime_ms])]

#Remove nulls
pre = [x for x in df[:pre] if x != nothing]
post = [x for x in df[:post] if x != nothing]

#Graph code
b = box([pre, post], names = ["WordPress", "Jekyll"])
b.ec_width = 800
colorscheme!(b, palette = ("acw", "VitaminC"))
yAxis!(b, name = "Load time in ms", nameGap = 50, min = 0)
title!(b, text = "randyzwitch.com",
           subtext = "Switching from WordPress on Bluehost to Jekyll on GitHub (2016/09/06)")
toolbox!(b)

Usually, a box plot comparison that is as smushed as the Jekyll plot vs the WordPress one would be a poor visualization, but in this case I think it actually works. The load time for the Jekyll version of this blog is so quick and so consistent that it barely registers as an outlier if it were WordPress! It’s crazy to think that the -1.5 * IQR time for WordPress is the mean/median/min load time of Jekyll.

Where To Go Next?

This blog post is really just an interesting finding from my experience moving to Jekyll on GitHub. As it stands now, ECharts.jl is stil in pre-METADATA mode. Right now, I assume that this would be a useful enough package to submit to METADATA some day, but I guess that depends on how much further I get smoothing the rough edges. If there are people who are interested in cleaning up this package further, I’d absolutely love to collaborate.

Julia 0.5 Release Announcement

By: Julia Developers

Re-posted from: http://feedproxy.google.com/~r/JuliaLang/~3/tyDIHJxQsDY/julia-0.5-release

After over a year of development, the Julia community is proud to announce
the release of version 0.5 of the Julia language and standard library.
This release contains major language refinements and numerous standard library improvements.
A long list of changes is available in the NEWS log found in our main repository, with a summary reproduced below.
A separate blog post detailing some of the highlights of the new release has also been posted.

We’ll be releasing regular bugfix backports from the 0.5.x line, which is recommended for users requiring a stable language and API.
Major feature work is ongoing on master for 0.6-dev.

The Julia ecosystem continues to grow, and there are now over one thousand registered packages!
The third annual JuliaCon took place in Cambridge, MA in the summer of 2016, with an exciting line up of talks and keynotes.
Most of them are available to view.

Binaries are available from the main download page or visit JuliaBox to try this release from the comfort of your browser. Happy Coding!

Notable compiler and language changes:

  • The major focus of this release has been the ability to write fast functional code, removing the earlier performance penalty for anonymous functions and closures.
    This has been achieved via each function and closure now being its own type, and the captured variables of a closure are fields of its type.
    All functions, including anonymous functions, are now generic and support all features.

  • Experimental support for multi threading.

  • All dimensions indexed by scalars are now dropped, whereas previously only trailing scalar dimensions would be omitted from the result.
    This is a major breaking changes, but has been made to make the indexing rules much more consistent.

  • Generator expressions now can create iterators that are computed only on demand.

  • Experimental support for arrays whose indexing starts from values other than 1. Standard Julia arrays are still 1-based, but external packages can implement array types with indexing from arbitrary indices.

  • Major simplification of the string types, unifying ASCIIString and UTF8String as String, as well as moving types and functions related to different encodings out of the standard library.

  • Package operations now use the libgit2 library rather than shelling out to command line git. This makes these calls to package related functions much faster, and more reliable, especially on Windows.

  • And many many more changes and improvements…

Ports

Julia now runs on the ARM and Power architectures, making it possible to use it on the widest variety of hardware, from the smallest embedded machines to the largest HPC systems. Porting a language to a new architecture is never easy, so special thanks to the people who made it possible. Part of the work to create the Power port was supported by IBM, for which we are grateful.

Developing with Julia

The Julia debugger, Gallium, is now ready to use. It allows for a full, multi language debug experience, debugging Julia and C code with ease. The debugger is also integrated with Juno, the Julia IDE that is now fully featured and ready to use.