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

Allow Asciidoctor.js to be used in AsciidoctorJ #189

Open
mojavelinux opened this Issue Aug 22, 2014 · 7 comments

Comments

Projects
None yet
2 participants
@mojavelinux
Member

mojavelinux commented Aug 22, 2014

Allow Asciidoctor.js to be used as an alternate Asciidoctor implementation in AsciidoctorJ. The focus here is on hiding the implementation behind the Asciidoctor interface and allowing the Factory to select implementation when the Asciidoctor object is instantiated.

There's no need to support Rhino. We should focus on Nashorn and dynjs. Between the two, we shouldn't show a favorite in AsciidoctorJ.

@mojavelinux

This comment has been minimized.

Show comment
Hide comment
@mojavelinux
Member

mojavelinux commented Aug 22, 2014

Here's a repository that contains a prototype: https://github.com/lordofthejars/asciidoctorjs

Asciidoctor.js is also being used in the AsciidocFX project: https://github.com/rahmanusta/AsciidocFX/blob/master/src/main/java/com/kodcu/service/AsciiDoctorRenderService.java

@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Aug 22, 2014

Member

I am going to start working on this on Monday. I will start with nashorn so we avoid adding a new dependency. But of course I would implement with dynjs to compare performance

Enviat des del meu iPhone

El 22/08/2014, a les 10.28, Dan Allen notifications@github.com va escriure:

Here's a repository that contains a prototype: https://github.com/lordofthejars/asciidoctorjs

Asciidoctor.js is also being used in the AsciidocFX project: https://github.com/rahmanusta/AsciidocFX/blob/master/src/main/java/com/kodcu/service/AsciiDoctorRenderService.java


Reply to this email directly or view it on GitHub.

Member

lordofthejars commented Aug 22, 2014

I am going to start working on this on Monday. I will start with nashorn so we avoid adding a new dependency. But of course I would implement with dynjs to compare performance

Enviat des del meu iPhone

El 22/08/2014, a les 10.28, Dan Allen notifications@github.com va escriure:

Here's a repository that contains a prototype: https://github.com/lordofthejars/asciidoctorjs

Asciidoctor.js is also being used in the AsciidocFX project: https://github.com/rahmanusta/AsciidocFX/blob/master/src/main/java/com/kodcu/service/AsciiDoctorRenderService.java


Reply to this email directly or view it on GitHub.

@mojavelinux

This comment has been minimized.

Show comment
Hide comment
@mojavelinux

mojavelinux Aug 27, 2014

Member

I think you could help encourage collaboration on this integration if you started a branch in the upstream repository. Perhaps just call it asciidoctor.js-integration or something.

Member

mojavelinux commented Aug 27, 2014

I think you could help encourage collaboration on this integration if you started a branch in the upstream repository. Perhaps just call it asciidoctor.js-integration or something.

@lordofthejars

This comment has been minimized.

Show comment
Hide comment
@lordofthejars

lordofthejars Aug 27, 2014

Member

I have just created one, i have refactored almost all code in next says i will sent you a summary and if we agree the contract then integrating asciidoctorjs will be really easy

Enviat des del meu iPhone

El 27/08/2014, a les 4.12, Dan Allen notifications@github.com va escriure:

I think you could help encourage collaboration on this integration if you started a branch in the upstream repository. Perhaps just call it asciidoctor.js-integration or something.


Reply to this email directly or view it on GitHub.

Member

lordofthejars commented Aug 27, 2014

I have just created one, i have refactored almost all code in next says i will sent you a summary and if we agree the contract then integrating asciidoctorjs will be really easy

Enviat des del meu iPhone

El 27/08/2014, a les 4.12, Dan Allen notifications@github.com va escriure:

I think you could help encourage collaboration on this integration if you started a branch in the upstream repository. Perhaps just call it asciidoctor.js-integration or something.


Reply to this email directly or view it on GitHub.

@mojavelinux

This comment has been minimized.

Show comment
Hide comment
@mojavelinux

mojavelinux Aug 27, 2014

Member

Nice!!

Member

mojavelinux commented Aug 27, 2014

Nice!!

@mojavelinux

This comment has been minimized.

Show comment
Hide comment
@mojavelinux

mojavelinux Dec 17, 2014

Member

I did some quick benchmarks against the last two EA builds of JDK8. My typical benchmark is the AsciiDoc Python user guide, which converts after warmup on my machine in 0.18s. Here are the results running Asciidoctor.js on Nashorn using jjs to give you an idea of where we stand performance wise.

.8u40-ea-b15
- Load scripts: 4.818s
- Run #1: 36.266s
- Run #2: 19.389s
- Run #3: 13.575s
- Run #4: 10.865s

.8u40-ea-b18
- Load scripts: 4.649s
- Run #1: 27.47s
- Run #2: 16.654s
- Run #3: 10.793s
- Run #4: 11.314s

It seems like Asciidoctor.js on Nashorn is about 50 times as slow as Asciidoctor Ruby (MRI or JRuby). That's not completely terrible, but not great. We should look keep an eye on improvements in both Nashorn and Opal to speed this up.

Member

mojavelinux commented Dec 17, 2014

I did some quick benchmarks against the last two EA builds of JDK8. My typical benchmark is the AsciiDoc Python user guide, which converts after warmup on my machine in 0.18s. Here are the results running Asciidoctor.js on Nashorn using jjs to give you an idea of where we stand performance wise.

.8u40-ea-b15
- Load scripts: 4.818s
- Run #1: 36.266s
- Run #2: 19.389s
- Run #3: 13.575s
- Run #4: 10.865s

.8u40-ea-b18
- Load scripts: 4.649s
- Run #1: 27.47s
- Run #2: 16.654s
- Run #3: 10.793s
- Run #4: 11.314s

It seems like Asciidoctor.js on Nashorn is about 50 times as slow as Asciidoctor Ruby (MRI or JRuby). That's not completely terrible, but not great. We should look keep an eye on improvements in both Nashorn and Opal to speed this up.

@mojavelinux

This comment has been minimized.

Show comment
Hide comment
@mojavelinux

mojavelinux Dec 17, 2014

Member

To provide some comparison, SpiderMonkey takes 3s and V8 takes 2.5s. However, unlike Nashorn, the native JavaScript implementations don't perform better on subsequent runs.

Member

mojavelinux commented Dec 17, 2014

To provide some comparison, SpiderMonkey takes 3s and V8 takes 2.5s. However, unlike Nashorn, the native JavaScript implementations don't perform better on subsequent runs.

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