Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format-date is slow #29

Open
waywardmonkeys opened this issue Jan 19, 2014 · 3 comments
Open

format-date is slow #29

waywardmonkeys opened this issue Jan 19, 2014 · 3 comments

Comments

@waywardmonkeys
Copy link
Member

format-date from the system library is slow. This is used for the response's date header, and in the logging code.

One issue here is that since that method is defined to take <string>, there is a lot of generic dispatch including each of the character comparisons.

An easy (but not really correct) fix is to have it take a <byte-string> for the format parameter and have date-stream be a <byte-string-stream> and give it a <byte-string> as the contents.

@brucehoult
Copy link

What happened to copy-down methods? I thought that was one of the major
features Open Dylan has but Gwydion doesn't?

It would also be completely correct, and faster than what you have now, to
do let format = as(<unicode-string>, format) at the start of the method.
That's a single GF dispatch, which having multiple copy-down methods
instead of a single method would also require.

It's not clear to me from
http://opendylan.org/documentation/library-reference/system/date.html whether
<date> is sealed.

@waywardmonkeys
Copy link
Member Author

copy down methods are probably one way to resolve this. (And for the record, copy down methods were added to the unreleased Gwydion Dylan 2.5).

It would take a minor bit of restructuring to make that work so that we can eliminate the dispatch on the temporary string stream as well. (Hopefully...)

@waywardmonkeys
Copy link
Member Author

dylan-lang/opendylan#650 is a start on addressing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants