Skip to content

Commit

Permalink
a couple i/o performance tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Apr 12, 2012
1 parent afc21f7 commit 3dff874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,7 @@ function done(itr::LineIterator, line)
end

function next(itr::LineIterator, this_line)
next_line = readline(itr.stream)
this_line, next_line
this_line, readline(itr.stream)

This comment has been minimized.

Copy link
@StefanKarpinski

StefanKarpinski Apr 12, 2012

Member

does this really help performance, or is this just a style thing?

This comment has been minimized.

Copy link
@JeffBezanson

JeffBezanson Apr 12, 2012

Author Member

It actually does because of our current very conservative inlining.

end

each_line(stream::IOStream) = LineIterator(stream)
Expand Down
5 changes: 4 additions & 1 deletion src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ jl_value_t *jl_array_to_string(jl_array_t *a)
// TODO: check type of array?
jl_struct_type_t* string_type = u8_isvalid(a->data, a->length) == 1 ? // ASCII
jl_ascii_string_type : jl_utf8_string_type;
return jl_apply((jl_function_t*)string_type, (jl_value_t**)&a, 1);
jl_value_t *s = alloc_2w();
s->type = (jl_type_t*)string_type;
jl_fieldref(s,0) = (jl_value_t*)a;
return s;
}

jl_value_t *jl_pchar_to_string(char *str, size_t len)
Expand Down

0 comments on commit 3dff874

Please sign in to comment.