• Yorick Peterse's avatar
    Use BufReader when reading bytecode from files · d80c4c30
    Yorick Peterse authored
    Using a 32KB buffer this allows us to drastically reduce the time spent
    parsing bytecode files. Consider the following program:
        import std::ansi
        import std::ffi
        import std::fs
        import std::mirror
        import std::stdio::stderr
        import std::stdio::stdin
        import std::stdio::stdout
        import std::time
        stdout.print('hello world')
    Prior to these changes, running this program (ignoring the compilation
    itme) takes around 240 milliseconds. With these changes, this is reduced
    to 20 milliseconds: a 12x improvement.
bytecode_parser.rs 25 KB