I write Engineering Topic weekly...?

Blog of web engineer at Tokyo. [Japanese version] http://taichiw.hatenablog.com/

1 million threads are executable in parallel with "Fiber" !? - Project Valhalla & Project Loom : JavaDayTokyo 2018 Report 2 #JavaDayTokyo

I attended sessions about Project Valhalla and Project Loom. Speaker of both sessions was Mr. David Buck *1.
Unfortunately, both functionality will not be in Java 11. Then, we can use them in actual service in 2021 *2 in the earliest case.

Project Valhalla

Value Types

Here is a class which has primitive type fields.

class Point {
   int x;
   int y;

Then, if we make these kind of array

  Point[] points;

each Point instances have their headers. Those will be huge overhead on memory.

This better if we think only memory optimization but it's not cool on object oriented programming.

  int[] xList;
  int[] yList;

So, here is one of solution*3.
If the class is declared with "value" like this, the memory allocation behave similarly to "primitive array".

value class Point {
   int x;
   int y;

Then, not only optimizing memory allocation, also improving speed for referencing each elements becomes possible.

Generic Specialization

In addition, the gap between primitive and class will be removed more.

For example, this declaration becomes possible.

ArrayList<int> xList;

In other example, we don't need "special implementation for primitive" like intStream anymore.
It's "not cool" that only primitive type variable requires special method.

Project Loom

On current JVM architecture, threads on JVM are mapped with threads managed by OS. The purpose of each threads might be different. Some of them might be used for very heavy process like encryption. On the other hand, some of them might be used for very light process, like just updating any variable. But OS need to make "thread, it's possible to use anything" because OS doesn't know what is the use for each threads.

Then, new idea "Fibers" was introduced. Fibers are threads, which are managed by run time of Java or user's code, not by OS. Application can manage threads (= Fibers) much better than OS because it knows how those threads are used. Surprisingly, JVM can generate thousand times threads than OS.

Blocking vs asynchronous

The traditional "thread way" is weak for scaling. Even if that thread is just waiting I/O, those are need to be kept on memory. As solution against this issue, "asynchronous" is used. But this way is difficult to coding / debugging. It's much more complex than "thread way".

"Fibers" can resolve these issues at once. The program can be kept simple because Fibers are just threads from program's perspective. On the other hand, it's strong for scalability too.

"Next era!"

Again, Fibers are threads. So each fibers has information "what will be executed" and "what has been executed". At the same time, those are objects managed by Java. Thus, they are "seriallizable".

Then... these will be possible.

  • Serialize and save a running thread. Next, stop JVM. Later JVM re-start and continue the saved thread.
  • On distributed database, transfer a process (= a fiber) between servers.

The current development stage

Right now, the development is on very early stage. Nothing is committed yet to remote repository because Developers just enjoy on their local machine lol
In the best case, any early access will be released within this year.

Anyway, this is very exciting improvement of Java. I'm looking forward to the release.

*1:He also ran demo of Fright Recorder in the keynote session. He looked so busy

*2:next LTS version is 17, will be released in 2021

*3:"How to write" is still under discussion. It's NOT fixed yet

Java11 : JavaDayTokyo2018 report 1 #JavaDayTokyo

I've attended to this year's JavaDayTokyo.

My personal themes was learning about these.

  • Java11, the LTS version being released half years after
  • Other upcoming functions
    • Especially about Project Valhalla. Recently, "How to treat huge size collection" is one of my important topic in my work.

Update of Java 11 from Java 10

These 8 JPEs will be added.

From them, the only update to "how to write code" looks this.
JEP 323: Local-Variable Syntax for Lambda Parameters

So, I think I can say the difference between Java 8 and Java 11 is "Jigsaw + 'var'".

The "Next" LTS version is 17

The next LTS version after 11 is 17, it will be released on September, 2021. It is 3 years after than 11's release.
(I had thought LTS is released per 1.5 years, but not)

Mission Control and Flight Recorder will be free, from JDK 11

From JDK 11, we can use Mission Control & Flight Recorder for free.
In key note session, the demonstration of them was held. It looked so useful for finding reason of performance issue.

I wanna use it for my huge & complex product !

"Align function" on PowerPoint

Power Point has "Align function". It's on very hidden place, but it's very helpful for formatting.

This is example of using "Distribute Horizontally" and "Align Left"



"The God of presenation", Mr. Madoka Sawa said, when he gets new computer, first he adds these function into "Quick access tool bar"


I heard that in this session. (sorry it's written in Japanese)


Regional Scrum Gathering® Tokyo 2014, Keynote speech by Ms. Jutta Eckstein #sgt2014

At 2nd day of Regional Scrum gathering Tokyo 2014, the keynote speech was "Introducing Agility into an Organization or: How to become Agile" by Jutta Eckestein.

This session gave me some great hints. They will help me to introduce something new to my team. This can be adapted to not only agile, also any other things.

Now, I'm trying to let our team members use TDD. So, this session was so useful for that. 

Typical Step of Change

She introduced 2 type pycological model about "Change". Elisabeth Kübler-Ross's one and Virginia Satir's one.

Jutta explained both of them with example of PowerPoint2010.

Elisabeth Kübler-Ross's model

  1. "I don't like UI of new PowerPoint. I'll continuously use old version"
  2. "I have to use new one."
  3. "I used to use new one. I don't hate new one anymore"

Virginia Satir's model

  1. Comfortable. "I like to use old PowerPoint".
  2. Chaos. "Sometimes I feel new one is good, but sometimes feel that is bad"
  3. Make sense. Understanding new one.
  4. Integration & Practice

We should understand  these "change" will cause in persons who are introduced something new.

How to introduce new things

Jutta told us 7 steps to introduce new things.

  1. Preparation (Explaning what we will try)
  2. Retrospective
  3. Readiness/Enabling Workshop
  4. (Customized) Training
  5. Monitoring / Coaching
  6. Sustaining Change
  7. Leassons Learned

Especially I was got strong impression from 3. and 4. So I'll explain them.

Readiness/Enabling Workshop

Classify "new things" to these 4 classes.

  1. What's we already do
    -> We might do some one already. For example, we don't call it "daily scrum", but we do morning meeting every day.
  2. What's easy to apply
  3. What's really difficult to apply
  4. What's impossible to do

Not only classify, also it's important to be clear what is blocker to do them.

In our team's case (starting TDD), No.1 is "Writing test code". Although the timing is after writing production code, anyway, all of us write test code.

(Customized) Training

After we decided to do something new, we will do training of that. But we should not create virtual issue for just the training because we cannot learn the skill to real issue by that.

We should "customize" training, which follow real issue.

3 Roles

Jutta also said, 3 roles should work together to start new things.

  • Passinate change agent
    -> The person who has passion to change something.
  • Project Leader
    -> He / She can construct relation with manager.
  • Architect / Technical leader
    -> The person who has high skill / knowleadge about the team's product. 

I think I'm so happy because now, my team's "Project Leader" & Architect are so collaborative.



 I got great hint to introduce something new to my team! I'm going to use these knowledge to adapt something new.

JavaOne2013 Overview : JavaOne2013 report 2 #JavaOne

This is overview report of JavaOne2013. I'll post each session's repot to here.



Why did I attend JavaOne?

In this year, I'm trying increasing my "technical skill", especialy programing skill. So, I tryed to attend technical conference about programing language.

What did I noticed when I choose sessions?

I had heard there are so many sessions in Java, but I was realy surprised that I need choose my sessions from huge number of them.


Through choosing my sessions, I found I was interested in REST, cloud, and operation. They were related my current tasks.

Since "Java technology" is so wide, and I didn't know which kind of technology was I interested in. But thanks to this "choosing", I could know my favor. This is one of what I learned.

What did I get / know / notice

The most impressive learning from JavaOne is that I realized that I have so many chance to consider and chose components consisting application.
In addition, I also noticed an importance of "practice swing" for choosing them.

Example1. choosing application server

"CON4117:The Adventurous Developer's Guide to Application Servers" gave me great learning.

In truth, I have not thought about application server deeply. I've used tomcat without thinking. But now, I know there are many kind of application servers, in addition, some of them were released in recent years. Now, I can consider which one is the best to each applications which have different strong point.

Example2. considering using Java8

About language, it is good experience that I imagined start of using Java8 on our work. By keynote and some session like "Programing with Lambda Expressions in Java", I could realize that the change to Java8 is so big, that we should adjust to this for readable code, and that every team members (of course, containing me) should learn it preliminarily to start using easily.

Attending overseas conference is realy bang for the buck?

Can't I realize such things without going overseas conference?
This attendance costed my company almost as same as my monthly salary.

Even so, I think going JavaOne is U.S. gave me such graet things.

Motivation of studing English

Since I could not understand each session well from my poor English skill

Realization my interest from tons of session theme

As I already told it, I could find my interest by chosing my session from unbelievable number of sessions.

Time for "practice swing". Training camp

In truth, I spent more time to "looking back" of sessions than hearing them. It means I sit down near the outlet, and learned more about session's theme, wrote program code, and posted blog.

It seems these things don't require going abroad. But actually it's very difficult to create enough time for that in daily life. Thanks to I was in another country, I could concentrate only technology. I thought it is like training camp of a sport.


This time, I could get those realization. I deeply appreciate this global opportunity.

Logo is so important for your community: JavaOne2013 report 1 #JavaOne #UGF10588

Now, I'm participating JavaOne2013.

My first session was "Organizing Your Local Community" by Mr. Ryan Cuprak.
I was interested in how bay area's guys organize their community because here is hometown of technical meet up.

Mr. Cuprak has organized a JUG (Java User Group) named CTJAVA since 2002. In this session, he talked about what he has learned, what was difficulty, and how he improved his community. He mainly talked about JUG, but I think those way is commonly useful to other kind of community.

To wrap up, I felt wherever difficult things is almost same. We need spent our time for organizing community, in addition it's required management skill, which is different from coding skill. At that, gathering people is so hard.
On the other hand, he could get that important skill, knowledge of current technical trend, and connection out of his work.

Well, he spoke the one of important stuff of community is "Logo". A log of community can illustrate a visual images of the community, and left that to other persons.

I strong agree that. I organize "10% rule" in my company. One day, I asked to design that's logo to my colleague. After that, I have been able to use it to presentation slides, sticker, and my desktop's back ground. I sometimes show my PC's screen as "advertisement" at meeting.

However, creating logo is difficult.
If you don't have good colleague, how can you get nice logo? Mr. Cuprak said (also, it's said generally) almost coder is not good designer.
He recommended 2 ways.

1. Asked to professional
Logo by professional has value than $2000.

2. Online logo services.
CT Java's log was created by this site.

As he said, both way can provide "iterative ideas" to you.

So, the logo is very important for your community.

“Demand Technical Excellence” by James Grenning Agile Japan 2013 #agilejapan

(This blog is English version of this Japanese blog)

I heard keynote speech of Agile Japan 2013, by James Grenning. He is a programer of embedded program. Recently, his book
has been translated in Japanese, and published.

【送料無料】Test-Driven Development for Embedded C [ James W. Grenning ]

Test-Driven Development for Embedded C [ James W. Grenning ]

And another thing he is the person who invented "Planning Porker"!

Today's speach's theme was "Demand Technical Excellence". We, developer needs to learn new things continuously. He explained us that by using TDD case as an example.

Bad Case

According to his speach, "someone still uses development method which was used in 1979". When James started programing in 1979, developer did "printf debug". It means, when they tried to debug, they wrote many printf statement, and checked each lines. And unfortunately, currently some developers still has been doing "printf debug". According an investigation, there are guys who spend much longer time to debugging than coding. Although coding is only phase to make value for customers. James called such development style DLP, "Debug Later Programing".

Let's TDD

So, what should we do?
We need to try TDD, which is much better than DLP. We can prevent from spending long time to debugging by repeating cycle of writing unit test and production code.

Even if TDD is difficult, we must write unit test because it's critical.
Because the more we proceed development, the more test cases of our product are increasing. By automated test, we don't have to spent long time to testing and debugging.

Technical Excellence

I think he wanted to tell us that  we need to learn new practice like TDD.

There is a practice, "retrospective" in scrum. We should consider about our issues (e.g.  many bugs, never finished test, and so on) by retrospective. And then, it is very important to learning new "technical excellence" for resolving those issues.

Todo of Developers and Scurm Masters

James introduced us todo of developers, scrum masters, and manager. (Since I'm not a manager, let me omit it)

Developers are required to make transparent their tasks. They are also required to learn and try new things. In addition, not only learning, also they should to be "adviser" of the new technology.

Scrum masters are required to help team members to get knowledge of new practices. I got advice from him that the first step is talking with team members how we solve an issue. For example, if our team don't have automation test, we will talk about what kind of technology we should learn.

Actually, currently, I think our team have to improve our team's automated test more and more. Fortunately, I've heard TDD boot camp will be carried out. So I'm going to attend it WITH my team members.