mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 07:06:12 +00:00
Switch 'rojo build' to use BufWriter, magic performance increase
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# Rojo Changelog
|
# Rojo Changelog
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
* Changed `rojo build` to use buffered I/O, which can make it up to 2x faster in some cases.
|
||||||
|
* Building [*Road Not Taken*](https://github.com/LPGhatguy/roads) to an `rbxlx` file dropped from 150ms to 70ms on my machine
|
||||||
|
|
||||||
## [0.5.0 Alpha 8](https://github.com/LPGhatguy/rojo/releases/tag/v0.5.0-alpha.8) (March 29, 2019)
|
## [0.5.0 Alpha 8](https://github.com/LPGhatguy/rojo/releases/tag/v0.5.0-alpha.8) (March 29, 2019)
|
||||||
* Added support for a bunch of new types when dealing with XML model/place files:
|
* Added support for a bunch of new types when dealing with XML model/place files:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::{
|
use std::{
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
fs::File,
|
fs::File,
|
||||||
io,
|
io::{self, Write, BufWriter},
|
||||||
};
|
};
|
||||||
|
|
||||||
use log::info;
|
use log::info;
|
||||||
@@ -92,7 +92,7 @@ pub fn build(options: &BuildOptions) -> Result<(), BuildError> {
|
|||||||
let mut imfs = Imfs::new();
|
let mut imfs = Imfs::new();
|
||||||
imfs.add_roots_from_project(&project)?;
|
imfs.add_roots_from_project(&project)?;
|
||||||
let tree = construct_oneoff_tree(&project, &imfs)?;
|
let tree = construct_oneoff_tree(&project, &imfs)?;
|
||||||
let mut file = File::create(&options.output_file)?;
|
let mut file = BufWriter::new(File::create(&options.output_file)?);
|
||||||
|
|
||||||
match output_kind {
|
match output_kind {
|
||||||
OutputKind::Rbxmx => {
|
OutputKind::Rbxmx => {
|
||||||
@@ -121,5 +121,7 @@ pub fn build(options: &BuildOptions) -> Result<(), BuildError> {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file.flush()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user