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

Revert imperative Utility.escape from 81d7e2a #102

Merged
merged 2 commits into from
Jun 7, 2017

Conversation

ashawley
Copy link
Member

@ashawley ashawley commented May 26, 2016

The current version of scala.xml.Utility.escape was contributed in 81d7e2a for scala/bug#3014. The method was changed for an issue concerning control characters. Benchmarking at that time happened to show that Scala 2.7 had either a poor performing implementation for Iterator or Map or both. This produced an escape function that was "3x-4x" slower than an imperative version using a while-loop and a pattern match.

Attached to the Jira issue is an XmlThing.scala benchmark program. I've re-run the benchmark program, and there's no evidence that the implementation is any faster than the original code in fc79c58.

I modified the XmlThing.scala program: I limited the test to 1-million iterations, down from 100-million so that the tests would take a second rather than a minute. I then ran the tests in groups of 384, and ran the implementations in different order.

benchmark program spreadsheet

I ran it with JMH, as well:

JMH benchmark spreadsheet

Here's the trial data (JMH is the second sheet):

https://docs.google.com/spreadsheets/d/1xZakvCKpZjaRO1QRMv3WySz4H6nGsNUgSMDm52pqKpM/edit?usp=sharing

Cheers to @vshalts for writing an SBT task that can run a program X times.

https://gist.github.com/vshalts/ed389bfb69b017f4dac7150cf0875529

@ashawley ashawley force-pushed the utility-escape-unimperative branch from e57fc5f to 9b9f556 Compare June 12, 2016 22:20
@ashawley ashawley force-pushed the utility-escape-unimperative branch 2 times, most recently from bfe8d22 to b78d0be Compare September 20, 2016 22:08
@ashawley ashawley force-pushed the utility-escape-unimperative branch from b78d0be to 140b3da Compare October 18, 2016 15:45
@ashawley ashawley force-pushed the utility-escape-unimperative branch from 140b3da to 2983077 Compare December 1, 2016 20:53
@SethTisue
Copy link
Member

needs rebase now. LGTM otherwise and I would suggest we merge in a few days, after the rebase, if there are no concrete objections

@ashawley ashawley force-pushed the utility-escape-unimperative branch 2 times, most recently from d7181e2 to 3b917fb Compare February 7, 2017 22:21
@ashawley ashawley force-pushed the utility-escape-unimperative branch from 3b917fb to 0cf7ab0 Compare February 15, 2017 23:31
@ashawley ashawley force-pushed the utility-escape-unimperative branch from 0cf7ab0 to 070f48a Compare April 25, 2017 14:00
@ashawley ashawley mentioned this pull request Apr 25, 2017
@ashawley ashawley force-pushed the utility-escape-unimperative branch 4 times, most recently from b6159ae to 5adca87 Compare April 28, 2017 18:28
@ashawley ashawley force-pushed the utility-escape-unimperative branch 3 times, most recently from afd3be6 to a3e3a5f Compare May 12, 2017 10:14
@ashawley ashawley force-pushed the utility-escape-unimperative branch 4 times, most recently from 60cfbde to 7456dad Compare May 24, 2017 17:56
@ashawley ashawley force-pushed the utility-escape-unimperative branch from 7456dad to 82f11b3 Compare May 25, 2017 14:29
@ashawley ashawley force-pushed the utility-escape-unimperative branch from 82f11b3 to 98bc791 Compare June 7, 2017 14:25
@ashawley ashawley merged commit ff66ccd into scala:master Jun 7, 2017
@ashawley
Copy link
Member Author

ashawley commented Jun 7, 2017

The final rebase I did last minute was just correcting a typo in the commit log. The code was the same.

@ashawley ashawley deleted the utility-escape-unimperative branch June 7, 2017 14:52
@ashawley ashawley mentioned this pull request Oct 9, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants