GithubHelp home page GithubHelp logo

mna / specter Goto Github PK

View Code? Open in Web Editor NEW
59.0 9.0 7.0 35.29 MB

a (tiny) VM project built with Go

License: BSD 3-Clause "New" or "Revised" License

Shell 2.20% Go 90.44% Makefile 7.36%
vm virtual-machine

specter's Introduction

Specter

Specter is an implementation of GenTiradentes' TinyVM in Go (the original is written in C).

This is very much to learn about virtual machines (this is my first attempt at a VM, so huge thanks to GenTiradentes for making a minimal one, easy to grasp).

The whole implementation takes about 500 lines of Go code.

Performance

It runs all examples available in TinyVM's repository, at roughly 30% slower than C, and at 7% slower with bounds-checking disabled. See more about the benchmarks in the bench subfolder.

Memory

Specter runs at a higher (but stable) memory footprint than its C counterpart, however note the following (copied from the mailing list, thanks to Carlos Castillo, edited):

BTW: The memory use [...] hovers at a high-ish number (70Mb in my case) because the garbage collection code doesn't run until memory use exceeds a given threshold. When it does, all the generated intermediate strings/slices are found but the memory is not returned to the OS, it is instead re-used for any following allocations, so the memory usage stat according to the OS stays at that threshold. If you set the environment variable GOGCTRACE=1 before running your code you can see when the garbage collector runs, and what happened during the run.

Thanks

The great Go community on the mailing list.

License

The BSD 3-Clause license.

specter's People

Contributors

mna avatar

Stargazers

 avatar liracle avatar CHENG KUN avatar Richard Jennings avatar  avatar Ralph Caraveo avatar yuning avatar ypcpy avatar Larry Xu avatar xmonader avatar  avatar Pana avatar  avatar tony eve avatar  avatar  avatar Guilherme Thomazi Bonicontro avatar JM avatar Bogdan U avatar EG avatar muhammedsemri404 avatar Stakhiv avatar  avatar photo avatar Marcin Maluszczak avatar  avatar Leonid Shirmanov avatar Brian Downs avatar  avatar  avatar Ajinkya Kulkarni avatar Nachi Ueno avatar Andrey Andrade avatar David Irvine avatar Ari avatar Ripta Pasay avatar  avatar Max Ekman avatar Ed Pom avatar Clyde Lingenfelter avatar Sebastien Binet avatar Daniel Gómez Jurado avatar winson wang avatar xy avatar maxiao avatar zhb avatar Julien Schmidt avatar  avatar  avatar  avatar zhangkaizhao avatar Çağlar Onur avatar metakeule avatar Terry Huang avatar Steve Phillips avatar jing avatar Bob TheBuilder avatar Edward avatar koyachi avatar

Watchers

jing avatar Jacob Santos avatar  avatar James Cloos avatar  avatar  avatar  avatar ltzmaxwell avatar solo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.